Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   using asp:textbox as search box, handling enter in textbox (http://www.velocityreviews.com/forums/t109215-using-asp-textbox-as-search-box-handling-enter-in-textbox.html)

Imran Aziz 09-03-2005 11:38 AM

using asp:textbox as search box, handling enter in textbox
 
Hello All,
I have an option of search on my web page coded as under

<p>Search Bookmarks: <asp:TextBox ID="txtSearch" runat="server"
class="texta" ></asp:TextBox><asp:Button ID="btnSearch" runat="server"
class="button" Text="go" OnClick="btnSearch_Click" UseSubmitBehavior="true"
/></p>



Now the issue is that although it works fine when the button is pressed, but
when someone enters text in the textbox and presses enter it does not do
anything, because the buttons OnClick event is not fired. How can I
associate the textbox with the button control, so that when someone does an
enter in the textbox then the buttons OnClick handler is called?



Imran.



Siva M 09-03-2005 12:22 PM

Re: using asp:textbox as search box, handling enter in textbox
 
Hi,

Check this one: http://aspnet.4guysfromrolla.com/articles/060805-1.aspx

"Imran Aziz" <imran@tb2.net> wrote in message
news:u$Vn6tHsFHA.3468@TK2MSFTNGP10.phx.gbl...
Hello All,
I have an option of search on my web page coded as under

<p>Search Bookmarks: <asp:TextBox ID="txtSearch" runat="server"
class="texta" ></asp:TextBox><asp:Button ID="btnSearch" runat="server"
class="button" Text="go" OnClick="btnSearch_Click" UseSubmitBehavior="true"
/></p>



Now the issue is that although it works fine when the button is pressed, but
when someone enters text in the textbox and presses enter it does not do
anything, because the buttons OnClick event is not fired. How can I
associate the textbox with the button control, so that when someone does an
enter in the textbox then the buttons OnClick handler is called?



Imran.




Imran Aziz 09-05-2005 11:00 AM

Re: using asp:textbox as search box, handling enter in textbox
 
Thanks a lot for the useful link.
Imran.

"Siva M" <shiva_sm@online.excite.com> wrote in message
news:uU0NyIIsFHA.3604@tk2msftngp13.phx.gbl...
> Hi,
>
> Check this one: http://aspnet.4guysfromrolla.com/articles/060805-1.aspx
>
> "Imran Aziz" <imran@tb2.net> wrote in message
> news:u$Vn6tHsFHA.3468@TK2MSFTNGP10.phx.gbl...
> Hello All,
> I have an option of search on my web page coded as under
>
> <p>Search Bookmarks: <asp:TextBox ID="txtSearch" runat="server"
> class="texta" ></asp:TextBox><asp:Button ID="btnSearch" runat="server"
> class="button" Text="go" OnClick="btnSearch_Click"
> UseSubmitBehavior="true"
> /></p>
>
>
>
> Now the issue is that although it works fine when the button is pressed,
> but
> when someone enters text in the textbox and presses enter it does not do
> anything, because the buttons OnClick event is not fired. How can I
> associate the textbox with the button control, so that when someone does
> an
> enter in the textbox then the buttons OnClick handler is called?
>
>
>
> Imran.
>
>
>





All times are GMT. The time now is 11:21 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.