473,946 Members | 12,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="dDwtMTU0 NzYzMDE">

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.Ha sKeys() 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 2884
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******@betti nghouses.com_NO SPAM> wrote in message
news:OO******** ******@TK2MSFTN GP09.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="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="dDwtMTU0 NzYzMDE">

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.Ha sKeys() 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.QuerySt ring 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=serv er".

Cheers,

Francois

"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:OH******** ******@TK2MSFTN GP12.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******@betti nghouses.com_NO SPAM> wrote in message
news:OO******** ******@TK2MSFTN GP09.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="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="dDwtMTU0 NzYzMDE">

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.Ha sKeys() 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
6807
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 the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
12
10044
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 process has been, from the site (in ASP), to: - select the top record from the members table where the assigned flag
2
8420
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 submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
3
1763
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), now my question is how to I get access to that control from the class in my first page? Whenever I try to access it I get a "object reference not set to an instance..." error. Thank you,
7
1580
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 do this for user controls easily using: oContent = (ControlBase) Page.LoadControl(Session + ".ascx"); this.plcContent.Controls.Add(oContent); but can not figure out how to do it for server controls. since I do not know what the control...
2
2105
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 tokens "IE5" and "PIE" are coming from the updated browser capabilities component. I'd like to do the same thing, but create my own tokens that have nothing to do with the browser capabilities component because I love the convenience this offers.
22
2215
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 stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of Administrator, one would be prevented from deleting a ticket not created by oneself. However, it did occur...
2
4943
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 being updated by some other process through remoting. When the page loads, I init the tree, and in my browser I can see the initialized tree. The problem is that every time that I receive update to tree from the remote process,
2
1363
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) $('assignedUsersInputs').appendChild(hidden); var i =0; for(var node = $('assignedUsersInputs').firstChild;node !=null; node = node.nextSibling) {
6
2536
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 get response from a Confirm() popup window to uncheck all server-side checkboxes placed in a panle of a web user control? I am using ASP.Net 2.0, Thanks. Need info...
0
10151
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
9980
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10685
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
9884
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...
0
7412
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
6328
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4933
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3538
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.