G
Griff
Hi
I have a web page (content.aspx) that inherits from a master page
(MasterPage.master).
The master page has a control (which has to be on every web page, hence on
the master page) (MasterControl.ascx). When placed on the master page this
appears as <uc1:MasterControl ID="MasterControl1" runat="server" />.
The MasterControl's Page_Init() event will contain some code to examine the
Request object's properties (cookies) and calculate some value that it will
expose as a property. This property is called "ImportantProperty()".
Content.aspx has a specific control on it (ContentControl.ascx). When
placed on the web page this appears as
<uc1:ContentControl ID="ContentControl1" runat="server" />.
The problem...
The ContentControl.ascx's Page_Load() event must call the
"ImportantProperty()" in the MasterControl. The resulting value dictates
which view (another user control) to dynamically load at run time
(View1.ascx, View2.ascx or View3.ascx).
MSDN gives an example of how to call a property on the MasterControl from
the Content.aspx page but NOT from a control on the Content.aspx page.
Microsoft's example can be found on:
http://msdn2.microsoft.com/en-us/library/c8y19k6h.aspx I've tried to amend
their example without success....could someone put me out of my misery
please?
Many thanks
Griff
I have a web page (content.aspx) that inherits from a master page
(MasterPage.master).
The master page has a control (which has to be on every web page, hence on
the master page) (MasterControl.ascx). When placed on the master page this
appears as <uc1:MasterControl ID="MasterControl1" runat="server" />.
The MasterControl's Page_Init() event will contain some code to examine the
Request object's properties (cookies) and calculate some value that it will
expose as a property. This property is called "ImportantProperty()".
Content.aspx has a specific control on it (ContentControl.ascx). When
placed on the web page this appears as
<uc1:ContentControl ID="ContentControl1" runat="server" />.
The problem...
The ContentControl.ascx's Page_Load() event must call the
"ImportantProperty()" in the MasterControl. The resulting value dictates
which view (another user control) to dynamically load at run time
(View1.ascx, View2.ascx or View3.ascx).
MSDN gives an example of how to call a property on the MasterControl from
the Content.aspx page but NOT from a control on the Content.aspx page.
Microsoft's example can be found on:
http://msdn2.microsoft.com/en-us/library/c8y19k6h.aspx I've tried to amend
their example without success....could someone put me out of my misery
please?
Many thanks
Griff