Q.
When
I clicked Enter key on Textbox in web application, my system will logout
automatically
A.
The
way we fix is to either set the DefaultButton property in the panel that it's
wrapped in, or the DefaultButton property on the form object.
<form id="Form1" runat="server">
<asp:Panel runat="server" DefaultButton="btndefaultbutton">
<div>
<asp:Button ID="btnLogout" Text="Log
out" runat="server"
OnClick="btnLogout_Click" />
<asp:Button ID="btndefaultbutton" Text="Log
out" runat="server" Style="display: none" />
</div>
</asp:Panel>
</form>
Or
<form id="Form1" runat="server" defaultbutton="btndefaultbutton">
<div>
<asp:Button ID="btnLogout" Text="Log
out" runat="server"
OnClick="btnLogout_Click" />
<asp:Button ID="btndefaultbutton" Text="Log
out" runat="server" Style="display: none" />
</div>
</form>
No comments:
Post a Comment