Set a button as default "enter" input.

J

Jensen bredal

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
 
G

Guest

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!
***************************
 
Joined
May 28, 2008
Messages
11
Reaction score
0
setting default button

hi,
i tried the given coding but it did not worked.when i press enter instead of login button it redirect to home page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top