I need to set the content page default button. My code is like this:
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"
defaultbutton="BtnSearch" defaultfocus="TxtSearchValue">
It is working fine, but my master page menu have one image button like chat, I can press the enter key to fire image button click event but it does not fire default button in content page.
How to handle this type of issue?
1) You simply have to do:
OR
2) Using Javascript:
And from the code behind:
I solved a similar problem with the following code.
Thx: http://www.w3schools.com/aspnet/prop_webcontrol_panel_defaultbutton.asp
Wrap all the asp.net controls and buttons inside the Panel and set default button property of panel with the id of a button.
Try this code