Condtional Region or Show/Hide Section

  • Thread starter Steve Lewis - Website Nation
  • Start date
S

Steve Lewis - Website Nation

In Classic ASP, if I wanted to show or hide a section of a page, I could
simply do:

<% If Variable = X Then %>

<p> Html or anything else to hide here </p>

<% End If %>

What is the best way to do this in ASP.Net? I have come across
everything from toggling the display of a <div> to setting the value of
a label.



--
____________________________
Steven K. Lewis
Website Nation, LLC
Website Development Services
www dot Website Nation dot com
 
B

Brock Allen

<asp:panel id=_myPanel runat=server>.....nested stuff in here.....</asp:panel>

Then in code, say in Page_Load:

void Page_Load(...)
{
bool MyCondition = DoSomeLogic();
_myPanel.Visible = MyCondition;
}
 
S

Steve Lewis - Website Nation

Thanks, I just came across an article about this as an option. It will
def. work!
____________________________
Steven K. Lewis
Website Nation, LLC
Website Development Services
www dot Website Nation dot com
 
P

Patrick Olurotimi Ige

Hi Steve,
I'm interested in something related can you please post the article
link.
Thanks
 

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,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top