Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Proper postback when Enter Key is pressed

Reply
Thread Tools

Proper postback when Enter Key is pressed

 
 
Jim in Arizona
Guest
Posts: n/a
 
      08-18-2006
I have a simple vb aspx page with a single text control and button
control. The user puts a date in the text field and pressed the button
and a gridview is filled with data. If I put in a date and just hit
enter, it looks like the page is posting back but nothing happens. I
don't know how to set the page to where if the user hits enter on the
keyboard, it is the same as clicking the button.

TIA,
Jim
 
Reply With Quote
 
 
 
 
Kumar Reddi
Guest
Posts: n/a
 
      08-18-2006
See this post
http://kumarr.net/blog/articles/11.aspx

Jim in Arizona wrote:
> I have a simple vb aspx page with a single text control and button
> control. The user puts a date in the text field and pressed the button
> and a gridview is filled with data. If I put in a date and just hit
> enter, it looks like the page is posting back but nothing happens. I
> don't know how to set the page to where if the user hits enter on the
> keyboard, it is the same as clicking the button.
>
> TIA,
> Jim


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      08-18-2006
You could use this free control to solve the problem.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"Jim in Arizona" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a simple vb aspx page with a single text control and button control.
>The user puts a date in the text field and pressed the button and a
>gridview is filled with data. If I put in a date and just hit enter, it
>looks like the page is posting back but nothing happens. I don't know how
>to set the page to where if the user hits enter on the keyboard, it is the
>same as clicking the button.
>
> TIA,
> Jim



 
Reply With Quote
 
Jim in Arizona
Guest
Posts: n/a
 
      08-18-2006
Kumar Reddi wrote:
> See this post
> http://kumarr.net/blog/articles/11.aspx
>


I followed that link and ended up on this web page:

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

So, just adding this control solved the issue:

<asp:TextBox runat="server" style="visibility:hidden;display:none;" />

Thanks for the help.
 
Reply With Quote
 
Jim in Arizona
Guest
Posts: n/a
 
      08-18-2006
Steve C. Orr [MVP, MCSD] wrote:
> You could use this free control to solve the problem.
> http://www.metabuilders.com/tools/DefaultButtons.aspx
>
> And here's a good article on the subject:
> http://www.allasp.net/enterkey.aspx
>


Very informative. I see there's a few ways to solve this issue.

Thanks Steve.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want <asp:textbox> to postback only when Enter key is pressed =?Utf-8?B?Sm9l?= ASP .Net 11 10-21-2005 11:43 AM
Enter Key H*ll, control enter key submit button BrianDH ASP .Net Web Controls 3 01-12-2005 08:29 PM
Control postback events when enter key is pressed jhoge123@yahoo.com ASP .Net 0 12-02-2004 02:21 PM
how to disable post back if enter key is pressed on th form gh0st54 ASP .Net 2 09-27-2004 06:41 PM
How to detect that a key is being pressed, not HAS been pressed earlier!?? Rune Python 6 01-29-2004 12:39 PM



Advertisments