473,769 Members | 7,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request.Form("_ _EVENTTARGET") = "" ???

Dan
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.

Nov 18 '05 #1
9 21494
Try Request.Form("_ _EVENTARGUMENT" )

:)

Mythran
"Dan" <no********@now here.com> wrote in message
news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #2
Dan
same..

just a blank string
"Mythran" <ki********@hot mail.com> wrote in message news:uH******** ******@TK2MSFTN GP12.phx.gbl...
Try Request.Form("_ _EVENTARGUMENT" )

:)

Mythran
"Dan" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #3
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["__EventTar get"] and eventArgument because Microsoft don't guaranteed that event reference will be always call like this.

Aurel
"Dan" <no********@now here.com> a écrit dans le message de news: #n************* *@TK2MSFTNGP11. phx.gbl...
same..

just a blank string
"Mythran" <ki********@hot mail.com> wrote in message news:uH******** ******@TK2MSFTN GP12.phx.gbl...
Try Request.Form("_ _EVENTARGUMENT" )

:)

Mythran
"Dan" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #4
Dan
hmm, so I wonder how I can find out what control caused the postback in the pageload..?
"Aurel" <We************ **@hotmail.com> wrote in message news:OL******** ******@tk2msftn gp13.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["__EventTar get"] and eventArgument because Microsoft don't guaranteed that event reference will be always call like this.

Aurel
"Dan" <no********@now here.com> a écrit dans le message de news: #n************* *@TK2MSFTNGP11. phx.gbl...
same..

just a blank string
"Mythran" <ki********@hot mail.com> wrote in message news:uH******** ******@TK2MSFTN GP12.phx.gbl...
Try Request.Form("_ _EVENTARGUMENT" )

:)

Mythran
"Dan" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #5
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("b tnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

string postBackControl = Request.Params. Get("__EVENTTAR GET");
"Dan" <no********@now here.com> wrote in message news:eM******** ******@TK2MSFTN GP09.phx.gbl...
hmm, so I wonder how I can find out what control caused the postback in the pageload..?
"Aurel" <We************ **@hotmail.com> wrote in message news:OL******** ******@tk2msftn gp13.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["__EventTar get"] and eventArgument because Microsoft don't guaranteed that event reference will be always call like this.

Aurel
"Dan" <no********@now here.com> a écrit dans le message de news: #n************* *@TK2MSFTNGP11. phx.gbl...
same..

just a blank string
"Mythran" <ki********@hot mail.com> wrote in message news:uH******** ******@TK2MSFTN GP12.phx.gbl...
Try Request.Form("_ _EVENTARGUMENT" )

:)

Mythran
"Dan" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.


Nov 18 '05 #6
And one other way...

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

If using VB :)

Mythran

"Alessandro Zifiglio" <al************ ****@NO-SPAM-hotmail.com> wrote in message
news:Lk******** ***********@new s.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("b tnSubmit") <> Nothing Then
--Do something---
Else
--Do something else---
End If

string postBackControl = Request.Params. Get("__EVENTTAR GET");
"Dan" <no********@now here.com> wrote in message
news:eM******** ******@TK2MSFTN GP09.phx.gbl...
hmm, so I wonder how I can find out what control caused the postback in the
pageload..?
"Aurel" <We************ **@hotmail.com> wrote in message
news:OL******** ******@tk2msftn gp13.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["__EventTar get"] and eventArgument
because Microsoft don't guaranteed that event reference will be always call like
this.

Aurel
"Dan" <no********@now here.com> a écrit dans le message de news:
#n************* *@TK2MSFTNGP11. phx.gbl...
same..

just a blank string
"Mythran" <ki********@hot mail.com> wrote in message
news:uH******** ******@TK2MSFTN GP12.phx.gbl...
Try Request.Form("_ _EVENTARGUMENT" )

:)

Mythran
"Dan" <no********@now here.com> wrote in message
news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #7
this only set for controls that you set autopostback on, it is blank for <asp:button> or <asp:imagebutto n>, as they use the standard form post rules.

-- bruce (sqlwork.com)

"Dan" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #8
Dan
ok, so how is it possible to acheieve similar results with an ASP:Button ?

Any ideas?
"bruce barker" <no***********@ safeco.com> wrote in message news:#x******** ******@TK2MSFTN GP09.phx.gbl...
this only set for controls that you set autopostback on, it is blank for <asp:button> or <asp:imagebutto n>, as they use the standard form post rules.

-- bruce (sqlwork.com)

"Dan" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #9
If your _EVENTTARGET is "" then you would need iterate through your Form Keys maybe Request.Form.Al lKeys(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" <no********@now here.com> wrote in message news:Od******** ******@TK2MSFTN GP10.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.

Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17768
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? Thanks, John
8
2426
by: Tom | last post by:
Hi I have an aspx page which has javascript to configure xmldata. I added breakpoint to the button method. When I click submit button, it did not go to those breakpoint and show the following error System.Web.HttpRequestValidationException (0x80004005) Detect the potential danger of Request.Form value from client side (idHidxml="<recordset><record><...") System.Web.HttpRequest.ValidateString(String s, String valueName, String...
2
497
by: Luke | last post by:
Hi I have the following code which is an ASP questionnaire using an Access database. (I am using access as I have no choice!). Basically there is an html form which submits the form to the page below and the code below submits the data to the DB and redirects the user. The code works locally on http://localhost or http://127.0.0.1 but when I upload it to a site (I have tried a few and they all error) it says "An error occurred on the...
7
5556
by: al | last post by:
Greetings all, I use request.form("textbox1") to get data back to page, dim str as string str = request.form("textbox1").tostring But str is always empty after refresh???? I use asp.net textbox control with form posting to itself.
1
5162
by: RJN | last post by:
Hi In VB.Net I can know the control which fired the event using Request.Form("__EVENTTARGET"). I tried the same in C#. But it always returned null. Any other way to find out? Regards Rjn
8
3087
by: abcd | last post by:
I can get the value on the form at the server side by using Request.form("max") when max field is disabled I dont get value. For GUI and business logic purpose I have disabled some fields with the values, but when I update Request.form does not return me anything for disabled fields. How to read disabled fields at the server side
7
1953
by: Rich | last post by:
Hi, I was experimenting with some basic sample asp code but can't get it to work correctly: this is bgselector.asp which works OK - you add the name of a basic color like blue, green, yellow and call another asp called backcolor.asp where I have the problem: bgselector.asp
0
1442
by: rahuls2930 | last post by:
hi, i m using asp+c#. and i do a database call when a button is clicked using __doPostBack. the database call succeeds and after that when i refresh the page the page again makes the database call due to the value stored in Request.Form.Since it is readonly i cant make it null how can i solve this problem?? Please help....
7
4445
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am surrendered to you. <%@ Language=VBScript%> <%Option Explicit%>
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.