Commerce Starter Kit 学习(3)

这一节,我们来看一下页面的加载.

这个网站需要用户认证的.其实这个认证是能过Forms验证来实现的,很简单.就是在用户登录或注册成功后,利用FormsAthentication.RedirectFromeLoginPage(customterId,T/F);就行了.简单吧!这样Request.IsAuthenticated就为true了.  可以用Request.IsAuthenticated判断就行了! 

 protected void Page_Init(object sender, EventArgs e) {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
        }

  #region Web Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent() {   
            this.SubmitBtn.Click += new System.Web.UI.ImageClickEventHandler(this.SubmitBtn_Click);

        }
  #endregion

 public CheckOut() {//页面类构造函数.
            Page.Init += new System.EventHandler(Page_Init);
        }

这就是一个窗体类的初始化的过程.

其实我们一般习惯这样写:private void Page_Load(object sender, System.EventArgs e) 
{ }
override protected void OnInit(EventArgs e)

    InitializeComponent(); 
    
base.OnInit(e);
}

private void InitializeComponent()

     
this.Load += new System.EventHandler(this.Page_Load);
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值