protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
第一个参数是名叫sender的object参数,表示引发事件的控件,表示点击的那个按钮
第二个参数是名叫e的EventArgs用于表示附加的事件关联的事件信息。只要第二个参数不是默认的EventArgs

参数,就可以知道一定有附加的事件信息传给了处理程序。

Page类包含IsPostBack属性,该属性用于检测页面是否已经回传给服务器端。
==========admin文件夹/web.config=======================
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <system.web>
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
</configuration>
===========================================
首页web.config

    <authentication mode="Forms">
      <forms name="AdminCookie" loginUrl="Default2.aspx" />
    </authentication>

============================Default2.aspx=================
验证成功后
System.Web.Security.FormsAuthentication.SetAuthCookie(username.Text.ToString(), false);

====================================安全退出====
System.Web.Security.FormsAuthentication.SignOut();