Page_Load

G

Guest

Is there a way to determine in Page_Load as a result of what action (what
button click) the form was submitted?

Thank you
 
E

Eliyahu Goldin

With autopostback property set to true, there will be two hidden variable in
your form __EVENTTARGET and __EVENTARGUMENT which you can access in
Page_Load event to get the control name which caused the postback.
__EVENTTARGET will have the object which fired the post back event.

Eliyahu
 
A

Andy Fish

AFAIK no

this is a bit of a pain sometimes. you may need to delay doing some
processing until the prerender event.

In one form, I just had all the event handlers set an instance variable
called WhichButtonWasClicked. Then I did all the work in PreRender

Andy
 
G

Guest

Both __EVENTTARGET and __EVENTARGUMENT return null.
I read on the web that some controls reset the value of these hidden fields.
Is there a way to overcome this problem or other ways to determine the
control that submitted the form?

Thanks.
 
B

bruce barker

execpt in the case of buttons which only pass their name in the postdata.

-- 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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top