Groups | Blog | Home
all groups > asp.net > april 2006 >

asp.net : Form submit in textbox when enter key hit


Steve C. Orr [MVP, MCSD]
4/5/2006 4:23:14 PM
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


[quoted text, click to view]

William Buchanan
4/5/2006 10:50:00 PM
Hi folks

I have a text box and a linkbutton on my home page. The linkbutton has a
postbackurl of "Page2.aspx" which displays result and also has it's own
search textbox.

On the home page, if I click the link button it works fine. However, if I
hit the Enter key in the text box, the page submits itself back to itself.

How can I get my home page to submit to Page2.aspx if Enter is hit in the
Textbox?

Thanks

Will

William Buchanan
4/7/2006 11:24:01 AM
Hi Steve

Thanks for the reply. Sorry for the delay in replying.

I couldn't get either option working. The trouble is (I should have
mentioned this) I am using master pages. I'm not sure if this is something
to do with the problem but either way the TieButton javascript was failing
because it couldn't find the objects it was referencing (which is strange
because they did exist (obviously because it compiled ok).

I will try again tonight!!

Thanks again.

Will


[quoted text, click to view]

AddThis Social Bookmark Button