Find and HTML Element

G

Guest

If I have an HTML element, say a <p> tag with and ID="Fred", how do I find
that element? I want to set the Style attribute to "hidden", how do I do
that?

Thanks!!!
 
D

darrel

If I have an HTML element said:
that element? I want to set the Style attribute to "hidden", how do I do
that?

If this is to toggle items on/off on screen, then this is probably a job for
javascript.

If it's to toggle items on/off via a postback, then I'd just use
labels/placeholders to hold the content and set those visbible states in the
codebehind.

Otherwise, you can put a runat="server" in the P tag and access it that way.

-Darrel
 
G

Guest

I am using javascript to turn on and off an error message based on an edit
which is imposed in the javascript. But when the page comes back to the
server I am going to run the test again at the server and hence I want to
turn the message on if I detect and error.

OK, I place a "runat="server" and then access, but I'm still not sure what
the code would look like to change the visibility property and I am not sure
which class I should use for the <P> element. Is this equate to the
"HtmlContainerControl"? That has no "Attibutes" property. Maybe I should
use the plain "HtmlControl"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top