Panel Control "Object reference..."

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.
 
M

Mark Fitzpatrick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top