Sunday, February 17, 2013

How to Set default button from C# to a Content Page

Here is how we can use default button property of the form to set Default Button for a content page from Code behind using C#
 
// Setting default button
this.Master.Page.Form.DefaultButton = this.btnSubmit.UniqueID;
 
Here is how we can set default button for the page which doesn’t have Master Page
// Setting Default Button           
this.Page.Form.DefaultButton = btnSubmit.UniqueID;
 
Hope this helps!!

No comments:

Post a Comment