473,396 Members | 2,108 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.

how to get non server control values?

Hi,

I have a form which contains some non server side controls.

I have seen in the generated HTML of a page that non server side controls
can be read by the server code (C# or VB.NET) as the the ASP.NET framework
itself generated non server side hidden fields used for the postaback.

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

I would like to myself use it but I did not find a way to access it. I tried
with the propoerty : request.Form but it seems empty as
Request.Form.HasKeys() returns false.

anyone can help me about how to read the different input fields (the body)
of the form in an old fashioned way (without using the server side
controls).

Thanks

Francois
Nov 19 '05 #1
2 2862
Francois,

You have to add attribute runat="server".

Just to clarify terminology. Server can access only server-side controls.
That is not to be mixed with asp.net controls. Any control, even classic
html one, with attribute runat set to "server" is a server-side one.

Eliyahu

"Francois" <fr******@bettinghouses.com_NOSPAM> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a form which contains some non server side controls.

I have seen in the generated HTML of a page that non server side controls
can be read by the server code (C# or VB.NET) as the the ASP.NET framework
itself generated non server side hidden fields used for the postaback.

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

I would like to myself use it but I did not find a way to access it. I tried with the propoerty : request.Form but it seems empty as
Request.Form.HasKeys() returns false.

anyone can help me about how to read the different input fields (the body)
of the form in an old fashioned way (without using the server side
controls).

Thanks

Francois

Nov 19 '05 #2
Actually there is no need to add the runat="Server". And my question was not
about how to access server side control but to access non server side
control. Sorry if i was not clear about that.

If you have some form fields or hidden fields that are not server control,
you can still access them through the Request.QueryString the Request.Form
collections.You will use the first collections in the case you submit the
form through a GET and the later if you submit the form through a POST.

As simple as that ! What i said in my first post was just stupid, it did not
work for me as i posted my form with a GET instead of a POST. It was just a
little thing i overlooked.

Of course this way to do is very particular to my specific problem. 99.9 %
of my code is using server control and then i don't need to do like that, i
just use the members of my code behind class to access the data of the form.
I just wanted to share this with people in case someone as the same problem
as me and need to access form fields that are NOT server controls and that
do not have "runat=server".

Cheers,

Francois

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Francois,

You have to add attribute runat="server".

Just to clarify terminology. Server can access only server-side controls.
That is not to be mixed with asp.net controls. Any control, even classic
html one, with attribute runat set to "server" is a server-side one.

Eliyahu

"Francois" <fr******@bettinghouses.com_NOSPAM> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a form which contains some non server side controls.

I have seen in the generated HTML of a page that non server side controls can be read by the server code (C# or VB.NET) as the the ASP.NET framework itself generated non server side hidden fields used for the postaback.

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

I would like to myself use it but I did not find a way to access it. I

tried
with the propoerty : request.Form but it seems empty as
Request.Form.HasKeys() returns false.

anyone can help me about how to read the different input fields (the body) of the form in an old fashioned way (without using the server side
controls).

Thanks

Francois


Nov 19 '05 #3

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

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
12
by: M Wells | last post by:
Hi All, I have a table that holds pregenerated member IDs. This table is used to assign an available member id to web site visitors who choose to register with the site So, conceptually the...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
3
by: Sophos | last post by:
Hi, I have a basic aspx page, in the Page_Init procedure I have a server.execute of another aspx page that adds some html code to my first page. However it also adds a control (an htmlimage),...
7
by: Tim | last post by:
I am trying to load both server and user controls into placeholder controls on a aspx template page at runtime. These values would be strings that are returned from a database query. I know I can...
2
by: Steve Franks | last post by:
In ASP.NET 2.0 you can now apparently do this: <asp:label runat="server" text="some browser" IE:text="any IE browser" IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" /> Now the...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
2
by: ayende | last post by:
I've a very strange issue here. I've this JS code: var hidden = document.createElement('input') //hidden.type='hidden'; hidden.value = getIdForUser(userTag)...
6
by: den 2005 | last post by:
Hi everybody, Question 1: How do you set the values from server-side to a client-side control or how do you execute a javascript function without a button click event? Question 2: How do you...
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
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,...
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.