Default button setup

T

tshad

I have 3 objects on my page (textbox,button and linkbutton)

When I put something in my textbox and hit "enter", the page gets posted,
but nothing happens. I don't go to either of the functions that both
buttons are set up for.

If I push the buttons directly, it works fine.

The Button is the first button on the page and the one I want to be default.
Is there something I have to do to make it a default button?

Thanks,

Tom
 
B

Bruce Barker

its a minor bug in IE. its supposed to post the first button, but fails in
this simple case (more controls it works better). google this newsgroup for
help on implementing a default button of your choice.

-- bruce (sqlwork.com)
 
T

tshad

Bruce Barker said:
its a minor bug in IE. its supposed to post the first button, but fails in
this simple case (more controls it works better). google this newsgroup
for help on implementing a default button of your choice.

Found it.

If I put

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

in the Page_Load event - it seems to work.

Thanks,

Tom
 
B

Brock Allen

They have provided a work-around in ASP.NET 2.0 with the <form runat=server
defaultButton="SomeButton"> directive.
 

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
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top