Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Literal HTML Controls in a Code-Behind Page 1

Status
Not open for further replies.

VBRookie

Programmer
May 29, 2001
331
US
This is my situation,

I have a page that has three form tags in it. On is a server form tag (for the main body portion of the site), the other two are regular old HTML form tags without the runat=server.

Is there anyway to reference the controls contained in the regular HTML tags from the code-behind file or do they have to have to be server controls to be able to do that?
 
They don't have to be server controls, but they do have to be contained in the server form.

If you just give a normal html form element an id, and then a declaration with "protected withevents" in the code-behind (like the server control declarations), then you will be able to access them.

If the page is a post back, though, you MIGHT be able to ask:

Request.forms[n]("elementName")

to get the value. I've never tried it, but it seems like it would work maybe.
penny1.gif
penny1.gif
 
Oh ... ok thanks link9. I will make some adjustments in my code and see what happens.

Thanks again!

- VBRookie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top