Pressing Enter fires ImageButton click event in asp.net

Posted by Sekar.C under ASP.NET on 6/16/2014 | Points: 10 | Views : 1338 | Status : [Member] | Replies : 1
Hi,
Pressing Enter fires ImageButton click event in asp.net

i have two panels
first panel have five text box and one normal asp button
eg:<asp:Panel ID="firstPanel" runat="server">
second panel have three text box and one image button in my page
eg:<asp:Panel ID="secondPanel" runat="server" DefaultButton="ibtSearch" >

if i pressing enter key on text box in second panel it fire first panel asp button event.

How can fire second panel image button event.

Regards
Sekar.c



Responses

Posted by: Goud.Kv on: 6/16/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi sekhar,

In the form tag, give your secondpanel-Image Id to defaultbutton like below,

<form runat="server" defaultbutton="secondpanelImg">
......
...
</form>


Thanks & Regards,
Krishna

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response