By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,313 Members | 2,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,313 IT Pros & Developers. It's quick & easy.

Set a button as default "enter" input.

P: n/a

Hello,
I have an html submit button wich i have converted into a server
control(ascx) .
I want it serverside click event to be fired on "enter".

How can this be achieved?

Many thanks in advance
JB

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Take a look at:
http://www.hanselman.com/blog/Commen...f-c243d9d1fdd2
and maybe even
http://www.allasp.net/enterkey.aspx

You'll be glad to know that in ASP.Net 2.0, this gets a lot easier!

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Jensen bredal" <ig******@bredhal.com> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...

Hello,
I have an html submit button wich i have converted into a server
control(ascx) .
I want it serverside click event to be fired on "enter".

How can this be achieved?

Many thanks in advance
JB

Nov 19 '05 #2

P: n/a
In Page_Load (at least generally), do the following:

Page.RegisterHiddenField("__EVENTTARGET", "NameOfDefaultButton")

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Jensen bredal" wrote:

Hello,
I have an html submit button wich i have converted into a server
control(ascx) .
I want it serverside click event to be fired on "enter".

How can this be achieved?

Many thanks in advance
JB

Nov 19 '05 #3

P: n/a
Great,
Many thanks
JB
Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.