Sections visible and not visible

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I have a page with many input variables and some are blank. I want to make
the row "not visible" if the field is blank.

For example:

<tr>
<td width="120" align="right" nowrap>
<asp:Label id="contactAddressHead" Text="Address:" runat="server"/>
</td>
<td>
<asp:Label id="contactAddress" TextMode="MultiLine" Columns="50"
rows="2" runat="server" />
</td>
</tr>

I tried to check contactAddress to see if it was blank and then make
contactAddressHead and contactAddress not visible, which it does. But the
line between the rows above and below are now larger.

What I need to do is make the row (tr) not visible. I thought about using
<div>, but how do I handle that in my server script?

Is there a better way?

Thanks,

Tom
 
you would have to put a runat="server" on it, give it an ID. It should
become an HtmlGenericControl in the .vb. Then you should be able to make it
not visible.
 
Marina said:
you would have to put a runat="server" on it, give it an ID. It should
become an HtmlGenericControl in the .vb. Then you should be able to make
it not visible.

That was what I was looking for.

Thanks,

Tom
 
More specifically you could add an ID and the runat attribute to your TR
tag. This way you'll be able to hanlde this tr (HtmlTableRow) and to set its
visible property to false...

Patrice

--
 
Patrice said:
More specifically you could add an ID and the runat attribute to your TR
tag. This way you'll be able to hanlde this tr (HtmlTableRow) and to set
its
visible property to false...

I didn't know you could do that? There is a visibility attribute to TR?

Tom
 

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

Back
Top