how do i determine what event caused postback

  • Thread starter Thread starter TS
  • Start date Start date
T

TS

Is there a way in debug mode to determine what event caused the postback to
occur without having an event handler for that event?

thanks
 
If it's a button, the ClientId of the control will be in the REquest.Form
collection.

Any control which does postback via javascript (textBox, linkbutton,
dropdownlist) will have the id in the __EVENTTARGET of the request.form
collection.

Karl
 
Ok, i have proven your two statements - i did not know this :)

But, i have a postback that occurred by hitting the enter key and posting
back, but the eventtarget is "" and the button on the form is not in the
request.form collection.

What other ways is a form submitted that will explain this? This all leads
to my discussion of why my click event is not executing on the server even
though the form is getting posted back (Re: hitting enter button while in
textbox calls correct button's click...)

Thanks for all the input, i can say i've learned something!
 
thank you sir.

FYI. I couldn't get these solutions to work, but i did run across one that
did: in IE 5/6 you must have at least 2 textboxes on the form and it will
work, so you just hide the extra "dummy" control.

thanks
 
Back
Top