473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

not declared error- control inside a control inside a webform

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
Nov 18 '05 #1
3 1647
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" <dc******@visiontechnology.net> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2
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:ev**************@TK2MSFTNGP14.phx.gbl...
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" <dc******@visiontechnology.net> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
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


Nov 18 '05 #3
ooop....I got it!!! thanks Karl!!

_____
dc g
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:Os*************@TK2MSFTNGP11.phx.gbl...
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:ev**************@TK2MSFTNGP14.phx.gbl...
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" <dc******@visiontechnology.net> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
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



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
5
by: William | last post by:
In Peer.h, I have: class Peer { // ... }; In Overseer.h, I have: #include "Peer.h" #include <vector>
7
by: bisforbenson | last post by:
I'm trying to compile things with gcc 4. After running the following command: % gcc -O3 -g -Wall -Wno-unused -DLINUX -D_REENTRANT -o ../../obj/egi.o -I../../include/ -I... -c egi.cpp i get...
1
by: Derek | last post by:
I am writing a web application for job seekers, and am adding a section that allows administrators to upload jobs to the system via xml. I have used an xml schema to validate the xml they upload....
1
by: Bimal | last post by:
Hi, I upgraded my gcc from 2.95 to 3.3. When I compile some projects I get error messages saying... /usr/local/include/c++/3.3/ctime:68: error: `tm' not declared...
3
by: JohnZing | last post by:
I'm usinf asp 2.0 and visual studio 2005 In html <img id="selcolorimg" runat="server" name="selcolorimg" src="image4.jpg"> I want to use selcolorimg in code behind, but vs2005 throws an error...
4
by: newbie120 | last post by:
Hi all maybe its just been a long day, but i have a question about call access modifiers in C#. Consider the following code. namespace Application { private class Class1 { int i;
14
by: Darren L. Weber | last post by:
I am trying to compile a utility to create .avi files. See http://cpbotha.net/im2avi I'm working on Debian etch (a mix of testing/unstable). dweber@dnlweber:~/im2avi-0.4$ g++ --version g++...
6
by: silversurfer2025 | last post by:
Hello world, I seem to go from one tricky error to the other (at least tricky for me). I am using qt and another code-package where many other files are stored which I need (written by someone...
6
by: jubelbrus | last post by:
I'm getting the following error, and from 40 to 300 similar error when I try to compile on mac os x. I believe that it has something to do with STL, because this error occures when I try to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.