470,620 Members | 1,711 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,620 developers. It's quick & easy.

how do i determine what event caused postback

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
5 4156
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
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
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
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
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.

Similar topics

18 posts views Thread by Christopher W. Douglas | last post: by
12 posts views Thread by Bob | last post: by
3 posts views Thread by Jordan | last post: by
reply views Thread by John A Grandy | last post: by
14 posts views Thread by Mike Collins | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.