Asp.net vb.net hide show control when page call is products.aspx

I have a master page and other content pages and i need to hide a control when user click in products.aspx page and show control when click in another page
rflorencioAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
If the control is located in the masterpage itself then you can checn the requested page and hide/show the control accordingly:


// in masterpage
protected void Page_Load(object sender, EventArgs e)
{
   if (Request.Url.AbsoluteUri.Contains("Products.aspx"))
      // hide the control
   else
      // show the control
}

Open in new window

0
 
Luis PérezSoftware Architect in .NetCommented:
In javascript, you can do the following:

document.getElementById('control_id').style.display = 'none'

Hope that helps. Maybe if you give more details of what control you want to hide/show it will be easier to answer.
0
All Courses

From novice to tech pro — start learning today.