ASP.NET Master page DefaultButton override

前端 未结 3 1777
心在旅途
心在旅途 2021-02-07 05:18

I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. On one of my pages I want to \"override\" the masterpage defaultbutto

3条回答
  •  无人及你
    2021-02-07 05:37

    Use UniqueId. Since you can have multiple server controls with the same server id, ie, in a GridView, the framework needs to the unique id to match up to.

    this.Form.DefaultButton = this.ibRecalc.UniqueID;
    

提交回复
热议问题