Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 09, 2012 01:09 PM by ssjGanesh
Participant
1970 Points
1395 Posts
Jun 09, 2012 07:57 AM|LINK
In Default.aspx page i have a searchbox and login box and registrationbox.
Each box having a <asp:button>.
If i enter login details and press enter the search box event fires.
but if i click by mouse it fires correct event.
so if i enter login details and press enter it should fires login button click event,
Same as if i enter search text and hit enter means it should fires the search b utton click event.
Same for registration.
So how can i do that....I think i need to track the keycode of enter key,....
Star
13465 Points
2022 Posts
Jun 09, 2012 11:50 AM|LINK
Use different panels for Login,Search and registration and set DefaultButton property
<asp:Panel runat="server" ID="pnlLogin" DefaultButton="btnLogin"> ...Login controls... </asp:Panel> <asp:Panel runat="server" ID="pnlSearch" DefaultButton="btnSearch"> ...Search controls... </asp:Panel> <asp:Panel runat="server" ID="pnlRegister" DefaultButton="btnRegister"> ...Registration controls... </asp:Panel>
.
Jun 09, 2012 01:09 PM|LINK
But i have only html button not asp buttons.
and i dont want set runat=server.
so how can i?
ssjGanesh
Participant
1970 Points
1395 Posts
Issue when press enter key instead click by mouse on a button
Jun 09, 2012 07:57 AM|LINK
In Default.aspx page i have a searchbox and login box and registrationbox.
Each box having a <asp:button>.
If i enter login details and press enter the search box event fires.
but if i click by mouse it fires correct event.
so if i enter login details and press enter it should fires login button click event,
Same as if i enter search text and hit enter means it should fires the search b utton click event.
Same for registration.
So how can i do that....I think i need to track the keycode of enter key,....
Mark as answer,if it helped U!
urenjoy
Star
13465 Points
2022 Posts
Re: Issue when press enter key instead click by mouse on a button
Jun 09, 2012 11:50 AM|LINK
Use different panels for Login,Search and registration and set DefaultButton property
.
ssjGanesh
Participant
1970 Points
1395 Posts
Re: Issue when press enter key instead click by mouse on a button
Jun 09, 2012 01:09 PM|LINK
But i have only html button not asp buttons.
and i dont want set runat=server.
so how can i?
Mark as answer,if it helped U!