473,396 Members | 1,599 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.

Rfer to HTML form elements

I would like to refer to HTML elements from my ASP.NET code do they have to
be server side

If yes then I can I set their html name for the POST method

Thank you,
Samuel
Nov 28 '06 #1
3 2798
If you're posting to an ASP.Net page, you can access any form variable
passed to it using the Request.Form["fieldname"] collection (where fieldname
is the name of the html form fields name).

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:Ox**************@TK2MSFTNGP03.phx.gbl...
>I would like to refer to HTML elements from my ASP.NET code do they have to
be server side

If yes then I can I set their html name for the POST method

Thank you,
Samuel

Nov 28 '06 #2
I want to fill the initial values of the fields before the server sends the
page to the user (in the load event of the form)

Thanks
Samuel
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
If you're posting to an ASP.Net page, you can access any form variable
passed to it using the Request.Form["fieldname"] collection (where
fieldname is the name of the html form fields name).

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:Ox**************@TK2MSFTNGP03.phx.gbl...
>>I would like to refer to HTML elements from my ASP.NET code do they have
to be server side

If yes then I can I set their html name for the POST method

Thank you,
Samuel


Nov 28 '06 #3
Then you would need to make references to them in the code-behind and set
their value attributes. All ASP.Net webform elements should have a
complementary HTMLForm elements. For example, an ASP.Net textbox equivalent
in HTML form is a System.Web.UI.HtmlControls.HtmlInputText.

To access it in codebehind you would assign it as a variable as so.
protected System.Web.UI.HtmlControls.HtmlInputText myfile = new
HtmlInputText;

You'll need to assign the runat="server" attribute for the Html form element
in order for it to work properly.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:eW**************@TK2MSFTNGP04.phx.gbl...
>I want to fill the initial values of the fields before the server sends the
page to the user (in the load event of the form)

Thanks
Samuel
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>If you're posting to an ASP.Net page, you can access any form variable
passed to it using the Request.Form["fieldname"] collection (where
fieldname is the name of the html form fields name).

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:Ox**************@TK2MSFTNGP03.phx.gbl...
>>>I would like to refer to HTML elements from my ASP.NET code do they have
to be server side

If yes then I can I set their html name for the POST method

Thank you,
Samuel



Nov 28 '06 #4

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

Similar topics

7
by: Bob Nolty | last post by:
Hi all -- I'm trying to create a hidden form in the document using only Javascript -- I don't know what form I want until the user clicks a button -- I tried the following code, which does...
4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
by: Newbie | last post by:
How would I modify this form to encode *all* the characters in the 'source' textarea to the '%xx' format & place result code into the 'output' textarea? (cross browser compatable) Any help is...
5
by: ojvm | last post by:
ok. thanks again for the time spend reading this. this code adds 2 controls in html form but it places in top of the form. i want this control1 control2 control1 control2 control1 ...
22
by: Luke | last post by:
Elements with name attribute: form, input, textarea, a, frame, iframe, button, select, map, meta, applet, object, param, img (if you know more reply...) Methods of addresing html elements:...
4
by: Sathyaish | last post by:
I am no JavaScript progammer, and unfortunately am having to babysit an old code base that has a lot of JavaScript in it. I have two questions: (1) Can two HTML controls have the same name? It...
6
by: Joe | last post by:
Hello All: Does anyone know the difference between the name and id attributes in an Html control? I noticed on PostBack that I can not retrieve the Request.Form("id_value") but I can retrieve...
29
by: Richard Lionheart | last post by:
Hi All, I've taken the advice of a few people and managed to cobble together an HTML 4.01 Strict-compliant document (according to the W3C Validation Service), but the way I try to pass a...
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
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
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,...
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
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...
0
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,...

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.