Panel Control "Object reference..."

  • Thread starter Thread starter cfps.Christian
  • Start date Start date
C

cfps.Christian

I'm at my wits end trying to figure out this stupid error.

<asp:Panel ID="pnlDep" runat="server">
<asp:Label ID="lblDep" runat="server" Text="Department:
" />
</asp:Panel>
<asp:Panel ID="pnlMaj" runat="server">
<asp:Label ID="lblMaj" runat="server" Text="Major: " />
</asp:Panel>

Now every other time I've used a panel I can reference it in my
codebehind without saying me.pnl = new Panel() but with this
particular instance I have to. Also along with this problem I add a
control to this panel and it doesn't show on the page, only the Labels
I added manually.
 
Are you using codebehind? If so, check to make sure that your codebehind
definition inthe page is pointing to the right filename and check to make
sure that the inherits attribute in the page directive exactly matches the
one in codebehind. This sort of behavior can happen when you have some odd
disconnect between the page, the codebehind, and/or the designer file.
 
Back
Top