<P> Visibility

G

Guest

Hello, I create a HTML line as follows:

<P class=text12BoldRed id=ErrTimePeriodSelection
style="VISIBILITY: hidden" runat="server">Selection of time period
either
not made or more then one type (Relative <EM>or</EM> specific time
period)
was selected</P>

I have javascript which performs an edit and turns the visibility on or off
as appropriate.

I want to make the same check on the server and if the edit fails, I want to
run the visibility to "Visible".

I have tried the following...

ErrTimePeriodSelection.Visible = true;
Nothing happens, when I look at the source, the visibility is still
"hidden"

ErrTimePeriodSelection.Attributes["VISIBILITY"] = "visible"
this cause the tag to appear twice, as below....

<P class=text12BoldRed id=ErrTimePeriodSelection
style="VISIBILITY: hidden" "Visibility="visible" runat="server">
This is obviously wrong.

So how do I find this attribute and set the visibility to "visible"?
 
M

mortb

In the code behind setting <yourControl>.Visible = true | false tells the
page if it should be rendered at all - it has nothing to do with the css
style attribute in the page source.
Setting the css style from the code behind you would write
<yourControl>.Style["visibility"] = "hidden";

cheers,
mortb
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top