Click here to Skip to main content
15,887,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i really new in asp.net i don't know how to capture the value in a textbox using enter event without any button or click buttons.

What I have tried:

i tried putting this inside of a panel and make the search button as a default but i dont want any button because it will affect my ui, i need a simple no buttons please.

Search :
                           <asp:TextBox ID="txtSearch" runat="server" ValidationGroup="search" Width="167px"></asp:TextBox>
                            
                           <asp:Button ID="btnSearch" runat="server" ValidationGroup="search" OnClick="btnSearch_Click" Text="Search" />
Posted
Updated 11-Feb-19 1:58am
v2
Comments
Member 14141512 11-Feb-19 5:27am    
You can use OnTextChanged() event of TextBox.By this way your search method will run when change text of TextBox.

1 solution

Take a look at the onTextChanged event
 
Share this answer
 
Comments
Richard MacCutchan 11-Feb-19 8:02am    
Please add the link to the documentation, or Google search results, so OP can go there direct.
RmcbainTheThird 11-Feb-19 8:51am    
Yes that would have been nice but I assume that anyone who has managed to find this site must be able to use google..or am I being to optimistic :)
Richard MacCutchan 11-Feb-19 8:55am    
Far too optimistic; stick around for a few life lessons.

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