Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Request.Form("__EVENTTARGET") = "" ??? (http://www.velocityreviews.com/forums/t771993-request-form-__eventtarget.html)

Dan 12-08-2003 02:29 PM

Request.Form("__EVENTTARGET") = "" ???
 
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.






Mythran 12-08-2003 04:50 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
Try Request.Form("__EVENTARGUMENT")

:)

Mythran


"Dan" <nottelling@nowhere.com> wrote in message
news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a
post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are
invoking a post back.

I've never used this type of method before, but I need to get the name of the
control doing the postback in the Form Load event, and cannot wait until the
event of the target control that runs due to the postback.






Dan 12-08-2003 06:16 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
same..

just a blank string
"Mythran" <kip_potter@hotmail.com> wrote in message news:uHxkcuavDHA.2456@TK2MSFTNGP12.phx.gbl...
Try Request.Form("__EVENTARGUMENT")

:)

Mythran


"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.






Aurel 12-08-2003 06:31 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
I have already ask for it, because I have the same pb since i change my framework1.0 to 1.1 !

The answer:
It is not a good way to use Request.Form["__EventTarget"] and eventArgument because Microsoft don't guaranteed that event reference will be always call like this.

Aurel


"Dan" <nottelling@nowhere.com> a écrit dans le message de news: #nTxddbvDHA.4060@TK2MSFTNGP11.phx.gbl...
same..

just a blank string
"Mythran" <kip_potter@hotmail.com> wrote in message news:uHxkcuavDHA.2456@TK2MSFTNGP12.phx.gbl...
Try Request.Form("__EVENTARGUMENT")

:)

Mythran


"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.






Dan 12-08-2003 06:49 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
hmm, so I wonder how I can find out what control caused the postback in the pageload..?
"Aurel" <WebGourou_NoSpam@hotmail.com> wrote in message news:OLSrDmbvDHA.2408@tk2msftngp13.phx.gbl...
I have already ask for it, because I have the same pb since i change my framework1.0 to 1.1 !

The answer:
It is not a good way to use Request.Form["__EventTarget"] and eventArgument because Microsoft don't guaranteed that event reference will be always call like this.

Aurel


"Dan" <nottelling@nowhere.com> a écrit dans le message de news: #nTxddbvDHA.4060@TK2MSFTNGP11.phx.gbl...
same..

just a blank string
"Mythran" <kip_potter@hotmail.com> wrote in message news:uHxkcuavDHA.2456@TK2MSFTNGP12.phx.gbl...
Try Request.Form("__EVENTARGUMENT")

:)

Mythran


"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.






Alessandro Zifiglio 12-08-2003 07:26 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
Not all controls postback the same way. You got various controls that postback and support different methods. Its been a long time and i dont rem what works with what off the top of my head. You might want to experiement with different methods. Here are the various methods you need to try and use. One of them is got to work for you ;)

If Request.Params.Item("btnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

If Request.Params("btnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

If Request.Form("btnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

string postBackControl = Request.Params.Get("__EVENTTARGET");
"Dan" <nottelling@nowhere.com> wrote in message news:eMfxBwbvDHA.1340@TK2MSFTNGP09.phx.gbl...
hmm, so I wonder how I can find out what control caused the postback in the pageload..?
"Aurel" <WebGourou_NoSpam@hotmail.com> wrote in message news:OLSrDmbvDHA.2408@tk2msftngp13.phx.gbl...
I have already ask for it, because I have the same pb since i change my framework1.0 to 1.1 !

The answer:
It is not a good way to use Request.Form["__EventTarget"] and eventArgument because Microsoft don't guaranteed that event reference will be always call like this.

Aurel


"Dan" <nottelling@nowhere.com> a écrit dans le message de news: #nTxddbvDHA.4060@TK2MSFTNGP11.phx.gbl...
same..

just a blank string
"Mythran" <kip_potter@hotmail.com> wrote in message news:uHxkcuavDHA.2456@TK2MSFTNGP12.phx.gbl...
Try Request.Form("__EVENTARGUMENT")

:)

Mythran


"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.







Mythran 12-08-2003 09:22 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
And one other way...

If Request("btnSubmit") Is Nothing Then
' The btnSubmit button was NOT clicked.
Else
' The btnSubmit button was clicked.
End If

If using VB :)

Mythran

"Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in message
news:Lk4Bb.14016$i_5.10515@news.edisontel.com...
Not all controls postback the same way. You got various controls that postback
and support different methods. Its been a long time and i dont rem what works
with what off the top of my head. You might want to experiement with different
methods. Here are the various methods you need to try and use. One of them is got
to work for you ;)

If Request.Params.Item("btnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

If Request.Params("btnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

If Request.Form("btnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

string postBackControl = Request.Params.Get("__EVENTTARGET");
"Dan" <nottelling@nowhere.com> wrote in message
news:eMfxBwbvDHA.1340@TK2MSFTNGP09.phx.gbl...
hmm, so I wonder how I can find out what control caused the postback in the
pageload..?
"Aurel" <WebGourou_NoSpam@hotmail.com> wrote in message
news:OLSrDmbvDHA.2408@tk2msftngp13.phx.gbl...
I have already ask for it, because I have the same pb since i change my
framework1.0 to 1.1 !

The answer:
It is not a good way to use Request.Form["__EventTarget"] and eventArgument
because Microsoft don't guaranteed that event reference will be always call like
this.

Aurel


"Dan" <nottelling@nowhere.com> a écrit dans le message de news:
#nTxddbvDHA.4060@TK2MSFTNGP11.phx.gbl...
same..

just a blank string
"Mythran" <kip_potter@hotmail.com> wrote in message
news:uHxkcuavDHA.2456@TK2MSFTNGP12.phx.gbl...
Try Request.Form("__EVENTARGUMENT")

:)

Mythran


"Dan" <nottelling@nowhere.com> wrote in message
news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that
caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that
invoke are invoking a post back.

I've never used this type of method before, but I need to get the
name of the control doing the postback in the Form Load event, and cannot wait
until the event of the target control that runs due to the postback.






bruce barker 12-08-2003 10:51 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
this only set for controls that you set autopostback on, it is blank for <asp:button> or <asp:imagebutton>, as they use the standard form post rules.

-- bruce (sqlwork.com)



"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.






Dan 12-09-2003 01:27 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
ok, so how is it possible to acheieve similar results with an ASP:Button ?

Any ideas?
"bruce barker" <nospam_brubar@safeco.com> wrote in message news:#xVuX3dvDHA.2308@TK2MSFTNGP09.phx.gbl...
this only set for controls that you set autopostback on, it is blank for <asp:button> or <asp:imagebutton>, as they use the standard form post rules.

-- bruce (sqlwork.com)



"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.






vMike 12-09-2003 03:59 PM

Re: Request.Form("__EVENTTARGET") = "" ???
 
If your _EVENTTARGET is "" then you would need iterate through your Form Keys maybe Request.Form.AllKeys(i) will work. I have never tried it. One of the keys has the control name and x and another has the controlname and y position I think.


"Dan" <nottelling@nowhere.com> wrote in message news:OdBF2eZvDHA.1764@TK2MSFTNGP10.phx.gbl...
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".

I am not really sure why, this happens for all of my controls that invoke are invoking a post back.

I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the postback.







All times are GMT. The time now is 06:25 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.