Search This Blog

Tuesday 9 June 2015

How can we solved Enter key logout problem on textbox in web application OR Application logout whenever I hit enter OR problem with logout button on the Master page

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="displaynone" />
            </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="displaynone" />
        </div>
    </form>


No comments:

Post a Comment