Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: type or namespace error


Message #1 by Cindy.Somerville@h... on Thu, 15 Aug 2002 19:56:41
HI

I?m working in a WebApplication project.

Could someone help me with an error that I get often?

When I try to write code in the ?code behind? in pageLoad, which refers to 
a control that I have placed in the aspx file, I get the same error.

*********************************************

The type or namespace name 'controlName' could not be found (are you 
missing a using directive or an assembly reference?)

************************************************
 
Could someone tell me what this error means? 
What am I missing?

I placed the name of the control in the id property. Is this right?

Thanks Cindy
Message #2 by "SUJEEWA ALWIS" <sujeewaalwis@a...> on Thu, 15 Aug 2002 23:02:48
I think you have to declare it as a variable (within the the Page class)


> HI

> I?m working in a WebApplication project.

> Could someone help me with an error that I get often?

> When I try to write code in the ?code behind? in pageLoad, which refers 
to 
a>  control that I have placed in the aspx file, I get the same error.

> *********************************************

> The type or namespace name 'controlName' could not be found (are you 
m> issing a using directive or an assembly reference?)

> ************************************************
 > 
C> ould someone tell me what this error means? 
W> hat am I missing?

> I placed the name of the control in the id property. Is this right?

> Thanks Cindy
Message #3 by "SUJEEWA ALWIS" <Sujeewaalwis@a...> on Thu, 15 Aug 2002 23:21:32
sorry, I meant inside the class derived from the Page class
such as the webform

> HI

> I?m working in a WebApplication project.

> Could someone help me with an error that I get often?

> When I try to write code in the ?code behind? in pageLoad, which refers 
to 
a>  control that I have placed in the aspx file, I get the same error.

> *********************************************

> The type or namespace name 'controlName' could not be found (are you 
m> issing a using directive or an assembly reference?)

> ************************************************
 > 
C> ould someone tell me what this error means? 
W> hat am I missing?

> I placed the name of the control in the id property. Is this right?

> Thanks Cindy
Message #4 by <cindy.somerville@h...> on Fri, 16 Aug 2002 7:45:07 -0400
Hi Sujeewa

This is the line of code that I have inside the class in formLoad.

************
string strNews =3D "hello world";
divListBylines.InnerHtml =3D strNews;
**************

And this is the line of code that I have in the html page

***********
<div id=3D"divListBylines" runat=3D"server"> </div>
***********


Cindy 
---------- Original Text ----------

From: "SUJEEWA ALWIS" <Sujeewaalwis@a...>, on 2002-08-15 7:21 PM:

sorry, I meant inside the class derived from the Page class
such as the webform

> HI

> I=C6m working in a WebApplication project.

> Could someone help me with an error that I get often?

> When I try to write code in the =E6code behind=C6 in pageLoad, which refers 
to 
a>  control that I have placed in the aspx file, I get the same error.

> *********************************************

> The type or namespace name 'controlName' could not be found (are you 
m> issing a using directive or an assembly reference?)

> ************************************************
 > 
C> ould someone tell me what this error means? 
W> hat am I missing?

> I placed the name of the control in the id property. Is this right?

> Thanks Cindy
---
Beginning ASP.NET 1.0 with C#
Entirely revised and updated for the final release, 
provides a step-by-step introduction with plenty of 
worked examples to help you to gain a deep understanding 
of what ASP.NET is all about, and how you can harness it 
to build powerful web applications. 
http://www.wrox.com/acon11.asp?ISBN=3D1861007345

Message #5 by "SUJEEWA ALWIS" <sujeewaalwis@a...> on Tue, 20 Aug 2002 08:41:14
Hi Cindy

I am not sure whether you can use HTML controls in "code behind"
but if you use the equivalent ASP.NET web form control <ASP:Panel> will 
do..

sujeewa

> 
Hi Sujeewa

This is the line of code that I have inside the class in formLoad.

************
string strNews =3D "hello world";
divListBylines.InnerHtml =3D strNews;
**************

And this is the line of code that I have in the html page

***********
<div id=3D"divListBylines" runat=3D"server"> </div>
***********


Cindy 
---------- Original Text ----------

From: "SUJEEWA ALWIS" <Sujeewaalwis@a...>, on 2002-08-15 7:21 PM:

sorry, I meant inside the class derived from the Page class
such as the webform

> HI

> I=C6m working in a WebApplication project.

> Could someone help me with an error that I get often?

> When I try to write code in the =E6code behind=C6 in pageLoad, which 
refers 
to 
a>  control that I have placed in the aspx file, I get the same error.

> *********************************************

> The type or namespace name 'controlName' could not be found (are you 
m> issing a using directive or an assembly reference?)

> ************************************************
 > 
C> ould someone tell me what this error means? 
W> hat am I missing?

> I placed the name of the control in the id property. Is this right?

> Thanks Cindy
---
Beginning ASP.NET 1.0 with C#
Entirely revised and updated for the final release, 
provides a step-by-step introduction with plenty of 
worked examples to help you to gain a deep understanding 
of what ASP.NET is all about, and how you can harness it 
to build powerful web applications. 
http://www.wrox.com/acon11.asp?ISBN=3D1861007345


  Return to Index