Condtional Region or Show/Hide Section

  • Thread starter Thread starter Steve Lewis - Website Nation
  • Start date 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
 
<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;
}


-Brock
DevelopMentor
http://staff.develop.com/ballen
 
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
 
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

Back
Top