Link to home
Start Free TrialLog in
Avatar of flukester
flukester

asked on

Conditional statement in .aspx page

I have a page where I am pulling data from a table and want to show contact information for everyone that is pulled. However, not everyone has all the information that I am going to show.  In my code behind I have a dataset, setup public variables and then use them in my page. How can I make it so in the example below the word Email: ...... only shows if there is email information? Basically I need an If Else statement in my main page. Here is how I am getting the values from the table:

commEmail = dsvss.Tables(0).Rows(0).Item("email")



h2>Committee Officers</h2>
		       <h3><%=commtitle%></h3>
                <p class="ofc"><b><%=commFullName%></b><br />
                <%=commCompany%><br />
                <%=commAddress1%><br />
                <%=commAddress2%><br />
                <%=commCity%>,&nbsp;<%=commState%>&nbsp;&nbsp;<%=commZip%><br>
                Phone:&nbsp;&nbsp;<%=commPhone%><br />
                FAX:&nbsp;&nbsp;<%=commFax%><br />
                Email:&nbsp;&nbsp;<a href="mailto:<%=commEmail%>"><%=commEmail%></a><br />
                Website:&nbsp;&nbsp;<a href="http://<%=commWebsite%>" target="_blank"><%=commWebsite%></a><br />
                Term:&nbsp;&nbsp;<%=commTerm%></p>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ororiole
ororiole
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of flukester
flukester

ASKER

Thanks ororiole