How to set the default button in content page using asp.net?

后端 未结 5 683
悲哀的现实
悲哀的现实 2020-12-18 20:29

I need to set the content page default button. My code is like this:



        
5条回答
  •  有刺的猬
    2020-12-18 21:21

    Try this code

    protected void Page_Load(object sender, EventArgs e)
        {
            this.form1.DefaultFocus = txtSearch.ClientID;
            this.Form.DefaultButton = btnSearch.UniqueID;
        }
    

提交回复
热议问题