By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,763 Members | 1,641 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,763 IT Pros & Developers. It's quick & easy.

how do i determine what event caused postback

P: n/a
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
Nov 28 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"TS" <ma**********@nospam.nospam> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
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

Nov 28 '05 #2

P: n/a
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!

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uH**************@TK2MSFTNGP10.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"TS" <ma**********@nospam.nospam> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
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


Nov 28 '05 #3

P: n/a
Ya, sometimes the enter key doesn't cause the button to click like you might
think it should.

You could use this free control to solve the problem.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here are a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"TS" <ma**********@nospam.nospam> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
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!

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uH**************@TK2MSFTNGP10.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"TS" <ma**********@nospam.nospam> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
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



Nov 28 '05 #4

P: n/a
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

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Ya, sometimes the enter key doesn't cause the button to click like you
might think it should.

You could use this free control to solve the problem.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here are a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"TS" <ma**********@nospam.nospam> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
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!

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uH**************@TK2MSFTNGP10.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"TS" <ma**********@nospam.nospam> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
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



Nov 29 '05 #5

P: n/a
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.

Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"TS" <ma**********@nospam.nospam> wrote in message news:es*************@TK2MSFTNGP15.phx.gbl...
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

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Ya, sometimes the enter key doesn't cause the button to click like you might think it should.

You could use this free control to solve the problem.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here are a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"TS" <ma**********@nospam.nospam> wrote in message news:u1**************@tk2msftngp13.phx.gbl...
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!

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"TS" <ma**********@nospam.nospam> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
> 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
>



Nov 29 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.