I have a scenario similar to the following:
<%@ Control language="vb" Inherits="ViewControl" AutoEventWireup="false" Explicit="True" Codebehind="ViewControl.as
cx.vb" %>
<%@ Register TagPrefix="lcs" TagName="PreferencesPage" Src="EditGradebook.ascx" %>
<%@ Register TagPrefix="lcs" TagName="ClassAttendancePa
ge" Src="ClassAttendancePage.a
scx" %>
<table>
<tr align="left">
<td>
<asp:panel id="pnlPreferencesPage" Visible="False" runat="server">
<lcs:PreferencesPage id="ctlPreferencesPage" runat="server"></lcs:Prefe
rencesPage
>
</asp:panel>
<asp:panel id="pnlClassAttendancePage
" Visible="False" runat="server">
<lcs:ClassAttendancePage id="ctlClassAttendancePage
" runat="server"></lcs:Class
Attendance
Page>
</asp:panel>
</td>
</tr>
<tr align="left">
<td>
<div class="container">
<asp:Panel ID="pnlMessageBox" runat="server">
<p><asp:Literal ID="ltlMessage" runat="server"></asp:Liter
al></p>
</asp:Panel>
</div>
</td>
</tr>
</table>
What I need to be able to do is to access the ltlMessage control, from inside the code-behind page of any of the child panel controls (like pnlClassAttendancePage as in pnlClassAttendancePage.Par
entControl
.ltlMessag
e which of course doesn't work).
Is there a way to accomplish this? I assume there is, but I am not worthy. There is nothing in the intellisense when in the code-behind page of a child panel that references the parent. I don't think the 'Parent' does it, but if it does, I haven't been able to get that to work.
Could someone show me an example using the above layout to allow me to access the pnlMessageBox from inside a pnlClassAttendancePage?
Start Free Trial