How to hide a text line?

  • Thread starter Miguel Dias Moura
  • Start date
M

Miguel Dias Moura

Hello,

I have a dataset "users" on an Asp.Net/VB web page.

I want to hide a line text if the field "Email" of the dataset is empty.

Can you tell me how to do this?

And is this applied to a <p>, <table>, <td>...?

Thanks,
Miguel
 
K

Karl Seguin

<body>
<form runat="server" id="form1">
<asp:literal id="email" runat="server" />
...
</form>
</body>


dim ds as DataSet = GetUserDataSet(UserID)
dim emailValue as object = ds.tables[0].Rows["email"]
if NOT emailValue is DbNull.Value andalso NOT cstr(emailValue).Length = 0
then
email.Text = cstr(emailValue)
end if


Karl
 

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,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top