how do i determine what event caused postback

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
 
K

Karl Seguin

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
 
T

TS

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

TS

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
 
J

Juan T. Llibre

I solved that problem by adding :
<input type="text" style="display:none">
to a page which only had one textbox and a submit button.

Now, hitting the enter key inside the textbox submits the form.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top