Link to home
Start Free TrialLog in
Avatar of caoimhincryan
caoimhincryan

asked on

call master page control

I have my master page control with a panel1 in it. Its property visible is set to false.

In one of my pages for example- Links.aspx I want to set the panel1 property visible = true in my master page.

Is this possible?
ASKER CERTIFIED SOLUTION
Avatar of cmhunty
cmhunty

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 Munawar Hussain
in  Links.aspx

 MasterPage ms = (MasterPage)Master;
        Panel pp = (Panel)ms.FindControl("Panel1");
        pp.Visible = true;
SOLUTION
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 caoimhincryan
caoimhincryan

ASKER

Thanks for the quick response. Both work great but actually doesnt display for the context Im using it. Let me explain.

I have my panel in master page. Then on my links page i override the onError method so as to display my own error message.

Protected Overrides Sub OnError(ByVal e As System.EventArgs)
        MyBase.OnError(e)

        '    'do stuff here
        UpdatePanel1.Visible = False
       
        CType(Me.Form.Parent.FindControl("ErrorHandlerPanel"), Panel).Visible = True

       Response.Write(Server.GetLastError().Message)

        Server.ClearError()
       

    End Sub

To test this i have added Throw New ApplicationException("Blahh") on my page load event.

All thats displayed is "Blahh" . Would anyone know how to display my panel?
I never specified that my error message is in my panel on the master page hence why I want it to display.
I split the points. I feel I need to ask a new question for my current issue.