RegisterHiddenField

H

harry

Hi all,

I have a form for the user to fill out. After they enter the required info,
the user hits the Enter key. The form is supposed to post back to the server
and process the info. I have used RegisterHiddenField in another
application before and works properly but for some reason, it is not working
in this application. Both applications reside on the same server. Can
anyone help?

In the page load I entered

Page.RegisterHiddenField("__EVENTTARGET", btnLogon.ClientID)



When the user hits ENTER, it takes the user to the home page and does not
call the event handler for that control.



Thanks

Harry
 
B

bruce barker

the hidden field "__EVENTTARGET" is only used when there is a control on the
page that uses autopostback. if you only have buttons, then the target value
is ignored. call Page.GetPostBackEventReference() to enable postback support


-- bruce (sqlwork.com)
 

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

Top