ASP.NET 第一天

来源:互联网 发布:java web spring mvc 编辑:程序博客网 时间:2024/05/17 23:12

Page_Lode事件:
每次加载都会被执行

 

Page.IsPostBack属性:
当页面第一次被加载时,其属性值为false,其余为true

 

关闭IE浏览器:
在Button中添加如下属性:onclick="window.close();"
在服务器端添加:this.btnClose.Attributes.Add("onclick","window.close();");

 

表单
<FORM action="页面名字" method="post"||"get">
</FORM>

 

当提交的方式为post时:
 获得字符串的方式有两种
  1:string s=Request["控件ID"].ToString();(索引器)
  2: string s=Request.Form.Get("控件ID").ToString();

当提交的方式为get时:
string s=Request.QueryString["控件ID"].ToString();

 

Response.Redirect("网页URL");

Response.Write();

原创粉丝点击