Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > not declared error- control inside a control inside a webform

Reply
Thread Tools

not declared error- control inside a control inside a webform

 
 
DC Gringo
Guest
Posts: n/a
 
      09-14-2004
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?


--
_____
DC G


 
Reply With Quote
 
 
 
 
Karl
Guest
Posts: n/a
 
      09-14-2004
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
--
MY ASP.Net tutorials
http://www.openmymind.net/


"DC Gringo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
>
> --
> _____
> DC G
>
>



 
Reply With Quote
 
 
 
 
DC Gringo
Guest
Posts: n/a
 
      09-14-2004
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




"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:(E-Mail Removed)...
> 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
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "DC Gringo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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?
> >
> >
> > --
> > _____
> > DC G
> >
> >

>
>



 
Reply With Quote
 
DC Gringo
Guest
Posts: n/a
 
      09-14-2004
ooop....I got it!!! thanks Karl!!

_____
dc g


"DC Gringo" <(E-Mail Removed)> wrote in message
news:Os7jh$(E-Mail Removed)...
> 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
>
>
>
>
> "Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
> message news:(E-Mail Removed)...
> > 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
> > --
> > MY ASP.Net tutorials
> > http://www.openmymind.net/
> >
> >
> > "DC Gringo" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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?
> > >
> > >
> > > --
> > > _____
> > > DC G
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
mfreidge mfreidge is offline
Junior Member
Join Date: Oct 2006
Posts: 3
 
      12-17-2007
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?


Quote:
Originally Posted by DC Gringo
ooop....I got it!!! thanks Karl!!

_____
dc g


"DC Gringo" <(E-Mail Removed)> wrote in message
news:Os7jh$(E-Mail Removed)...[color=blue]
> 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
>
>>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using one webform to set a value on another webform =?Utf-8?B?bXN1aw==?= ASP .Net 1 07-12-2006 07:23 PM
declared or not declared ? JohnZing ASP .Net 3 02-05-2006 08:38 PM
not declared error- control inside a control inside a webform DC Gringo ASP .Net Web Controls 3 09-14-2004 09:29 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Including WebForm Image Control in a Webform Table Control titof ASP .Net 0 07-24-2003 01:01 PM



Advertisments