473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

where is __EVENTTARGET ?

hello,

i am attempting to get my asp.net form to "remember" scroll position on
post, as written in this short simple article:

http://www.dotnetjunkies.com/Article...CB3C4A1AB.dcik

....however, my page busts on the server request to
Request.Form["__EVENTTARGET"], saying it's not there. indeed, when i
view the html source of my asp.net form, there is no hidden input field
by that name. but according to the article, there should be these two:

<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />

i checked some of my other forms, didnt see it in those, either.

anyone know what's up?

thanks,
matt

Nov 19 '05 #1
5 5208
These 2 hidden controls will be added automatically by the ASP.NET parser at
runtime immediately after a <form runat=server> start tag, so you need not
bother with it. Just remember to have a server-side form included.

<Ma****************@CapitalOneAuto.com> ???
news:11*********************@z14g2000cwz.googlegro ups.com ???...
hello,

i am attempting to get my asp.net form to "remember" scroll position on
post, as written in this short simple article:

http://www.dotnetjunkies.com/Article...CB3C4A1AB.dcik
...however, my page busts on the server request to
Request.Form["__EVENTTARGET"], saying it's not there. indeed, when i
view the html source of my asp.net form, there is no hidden input field
by that name. but according to the article, there should be these two:

<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />

i checked some of my other forms, didnt see it in those, either.

anyone know what's up?

thanks,
matt

Nov 19 '05 #2
You can only count on it being generated if at least one control that needs
it is on the page. For example, it will appear if a textbox has
AutoPostBack="True"

<asp:textbox id="TextBox1" runat="server"
AutoPostBack="True"></asp:textbox>

Ken
Microsoft MVP [ASP.NET]
<Ma****************@CapitalOneAuto.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
hello,

i am attempting to get my asp.net form to "remember" scroll position on
post, as written in this short simple article:

http://www.dotnetjunkies.com/Article...CB3C4A1AB.dcik

...however, my page busts on the server request to
Request.Form["__EVENTTARGET"], saying it's not there. indeed, when i
view the html source of my asp.net form, there is no hidden input field
by that name. but according to the article, there should be these two:

<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />

i checked some of my other forms, didnt see it in those, either.

anyone know what's up?

thanks,
matt


Nov 19 '05 #3
im not sure you understand.... as i said, i have a webform. that,
inheritantly means i have the server-side form tags; but i do not see
the hidden fields.

Nov 19 '05 #4
i see. so it only shows up forms w/ AutoPostBack=true. ok.

hmm. well, for my need, i just want to have it there so that i can do
the hfref.location trick, as in the article. i only have text boxes in
my webform...nothing that has a need for AutoPostBack. is there another
to get those tags to show up? can i set autopostback to a non-visible
form element?
thanks,
matt

Nov 19 '05 #5
A webform do not necessarily implies that it has a server-side form tag, so
it isn't inheritantly said.

It's legal to have <asp:Literal runat=server> at a webform outside a
server-side form tag, and I have a webform that uses <asp:Panel
runat=server> to hide the server-side form tag on purpose.

And there's some people still want to access postback value of controls by
Request.Form[], not using the object modal. So I just wanted to make sure...

<Ma****************@CapitalOneAuto.com> ???
news:11**********************@z14g2000cwz.googlegr oups.com ???...
im not sure you understand.... as i said, i have a webform. that,
inheritantly means i have the server-side form tags; but i do not see
the hidden fields.

Nov 19 '05 #6

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

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
3
by: A.V.C. | last post by:
Hello, I found members of this group very helpful for my last queries. Have one problem with CASE. I can use the column name alias in Order By Clause but unable to use it in WHERE CLAUSE. PLS...
3
by: Xiangliang Meng | last post by:
Hi, all. In 1998, I graduated from Computer Science Dept. in a university in China. Since then, I've been using C Language for almost 6 years. Although I'm using C++ in my current job, I'm also...
0
by: Frankieboy | last post by:
Where is __doPostBack-function defined? I've got an application which generates a different __doPostBack-function when the code is being run on the server compared to the one on my laptop. The...
9
by: Dan | last post by:
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...
2
by: Nuno | last post by:
Hi I create a new .aspx page only with a button and a span (as you can see)...simple When I try to click the button returns JS error (__EVENTTARGET is null or not an object). I research about...
1
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
0
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...
1
by: Kenneth Baltrinic | last post by:
I am having a very odd problem. On a page that was working until very recently we are now encountering the following situation: The page is a very basic fill in the blank form used for changing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.