1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Setting Content Block Visibility from a user control

Setting Content Block Visibility from a user control

1 posts, 0 answered
  1. David
    David avatar
    16 posts
    Registered:
    10 Apr 2012
    17 Apr 2012
    Link to this post
    On my page, I have a content block that was dragged on to the page.  I named it 'MainContentBlock'.  I also have a custom widget that has a postback.  When a user clicks a link and causes a postback, I want to set the Visibility of MainContentBlock = false from inside the custom widget code behind.
    How can I do this?
    Something like this in the page_load of my user control:
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            {       
             //set the visibility of the dragged content block here
             Parent.FindControl("MainContentBlock").Visible = false;
             }
    }

1 posts, 0 answered