代码可简化成
if(!IsPostBack)
{
ExportEuropeRate(int.Parse(Request.["gameid"]));
}
另:对于页面中变量,是不会保存的。
比如
private int i =10;
private void Page_Load(object sender, System.EventArgs e)
{
…………
}
每次页面提交到服务器, i 的值都会初始为 10如果想保存 i 的话,
一是用
Session["ID"]=i;
读取
this.i =(int) Session["ID"];二是加一个 Visible=false 的 Label 或是其它隐形控件
this.Label1.Text=i.ToString();
if(!IsPostBack)
{
ExportEuropeRate(int.Parse(Request.["gameid"]));
}
另:对于页面中变量,是不会保存的。
比如
private int i =10;
private void Page_Load(object sender, System.EventArgs e)
{
…………
}
每次页面提交到服务器, i 的值都会初始为 10如果想保存 i 的话,
一是用
Session["ID"]=i;
读取
this.i =(int) Session["ID"];二是加一个 Visible=false 的 Label 或是其它隐形控件
this.Label1.Text=i.ToString();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货