Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hello,
i have a text box control so how can be set focus of this text box control to button so that when we type some text in text box and press enter then button click event fired automatically

thanks & regards
srishti
Posted

1 solution

XML
<asp:Panel id="panel1" runat="server" DefaultButton="Button1">
   <asp:TextBox id="textbox1" runat="server" />
   <asp:Button id="Button1" runat="server" Text="Button 1" />
</asp:Panel>
 
Share this answer
 
Comments
srishti056 13-May-13 1:17am    
its not working when we enter then button click event was not fired i want that when i enter some text on text box and press enter then button click event fired automatically
srishti056 13-May-13 2:58am    
i dont want to see this button on my page bt if i set it visible="false" then it is not working what should i do for this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900