not declared error- control inside a control inside a webform

D

DC Gringo

I've got a web user control (a) inside a web user control (b) inside a
webform (c). I need the webform to set a label control text value inside
the inner of the two web user control.

Inside my web form's code behind I have:

mainHeader1.sectionHeader1.theSectionHeader.text = "Eritrea"
I'm getting "mainHeader1 is not declared" error.

What am I doing wrong?
 
K

Karl

you aren't declaring mainHeader1 *g*

I take it on your page you have

it's hard to know what's wrong without seeing the html...

but looking at it, I'd expect to see:

In the page:
<sometag:somecontrol1 id="mainHeader1" runat="server" />

in somecontrol1:
<sometag:somecontrol2 id="sectionHeader1" runat="Server" />

in somecontrol2:
<asp:label id="theSectionHeader" runat="erver" />


Then in page codebehind
protected mainHedaer1 as somecontrol

sub page_load
mainHeader1.sectionHeader1.theSectionHeader.text = "Eritrea"
end sub


in somecontrol1 codebehind:
public sectionHeader1 as somecontrol2


in somecontrol2
public theSectionHeader as label


Karl
 
D

DC Gringo

Karl,

Thank you for your attention. I think I'm almost there. I did what you
said and still come up with:

The base class includes the field 'SectionHeader1', but its type
(fn3p2.mainHeader) is not compatible with the type of control
(ASP.sectionHeader_ascx).

Line 33: <UC1:SECTIONHEADER ID="SectionHeader1"
RUNAT="server"></UC1:SECTIONHEADER>

Source File: D:\webs\projects\fewsnet\fn3.0\r3\mainHeader.ascx

_____
DC G
 
D

DC Gringo

ooop....I got it!!! thanks Karl!!

_____
dc g


DC Gringo said:
Karl,

Thank you for your attention. I think I'm almost there. I did what you
said and still come up with:

The base class includes the field 'SectionHeader1', but its type
(fn3p2.mainHeader) is not compatible with the type of control
(ASP.sectionHeader_ascx).

Line 33: <UC1:SECTIONHEADER ID="SectionHeader1"
RUNAT="server"></UC1:SECTIONHEADER>

Source File: D:\webs\projects\fewsnet\fn3.0\r3\mainHeader.ascx

_____
DC G
 
Joined
Oct 3, 2006
Messages
3
Reaction score
0
The base class includes the field , but its type is not compatible

I have similar error
The base class includes the field 'ctlDateSelector', but its type (MyControls.DateSelector) is not compatible with the type of control (ASP.admin_dateselector_ascx).

What you've done to fix it?


DC Gringo said:
ooop....I got it!!! thanks Karl!!

_____
dc g


"DC Gringo" <[email protected]> wrote in message
news:[email protected]...
> Karl,
>
> Thank you for your attention. I think I'm almost there. I did what you
> said and still come up with:
>
> The base class includes the field 'SectionHeader1', but its type
> (fn3p2.mainHeader) is not compatible with the type of control
> (ASP.sectionHeader_ascx).
>
> Line 33: <UC1:SECTIONHEADER ID="SectionHeader1"
> RUNAT="server"></UC1:SECTIONHEADER>
>
> Source File: D:\webs\projects\fewsnet\fn3.0\r3\mainHeader.ascx
>
> _____
> DC G
>
>>
 

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

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top