Allow Enter key to login in asp.net?

后端 未结 4 1362
南笙
南笙 2021-01-02 04:51

I have a standard asp:login control:



        
4条回答
  •  半阙折子戏
    2021-01-02 05:10

    In the designer of your Login control: "Convert To Template". Then in the Page Load set the defaultButton of your form by finding the LoginButton.

    ASPX:

    .....

    Code-Behind:

        protected void Page_Load(object sender, EventArgs e)
        {
            Button lbButton = Login1.FindControl("LoginButton") as Button;
            form1.DefaultButton = lbButton.UniqueID;
        }
    

提交回复
热议问题