IsPostBack奇怪的现象 晕,明明只有一行Response.Write,怎么调用两次了呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 IsPostBack是判断是否是第一次Page_Load的属性,所以你第一次访问时打印出1,因为单击按钮等很多事件都会回传造成Page_Load事件再次执行,而你后面提交的就引发了Page_Load事件的再次,但你用if语句做了判断,所以打印出2来 public class Test:Page{private void Page_Load(object sender,System.EventArgs e){if(!IsPostBack){Response.Write("2"); }else{Response.Write("1");} }override protected void OnInit(EventArgs e){InitPage();base.OnInit(e); }private void InitPage(){this.Load += new System.EventHandler(this.Page_Load);}} 寻找物资采供管理系统的高手实现物资上月库存+收入-发出 =本月收入的算法?物资收发存报表 在GridView中如何写类似的提示功能? ISWebGrid 如何获取选中的列的值 求教?如何用.net实现一键转发功能? 网页问题 继续求教 怎么才能生成以前正常的表格呢? ASP.NET做的软件,怎样防止交给客户后,客户在多处安装使用~ .NET IDE的解决方案中右键工程名选属性 调试怎么什么都不显示啊? DataGrid中就地编辑时TextBox控件没有返回值??? 调用word和Excel的错误 送分题来咯~~~~
private void Page_Load(object sender,System.EventArgs e){
if(!IsPostBack){
Response.Write("2");
}
else{
Response.Write("1");
}
}override protected void OnInit(EventArgs e){
InitPage();
base.OnInit(e);
}private void InitPage(){
this.Load += new System.EventHandler(this.Page_Load);
}
}