473,473 Members | 4,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't declare a usercontrol in a Class

ad
We can declarre a web controls in a class, like:

public class HealthClassBase: System.Web.UI.Page
{
public TextBox myTextBox;
.......
But if TUserControl is a Web UserControl.
When I declare it in a class like:

public class HealthClassBase: System.Web.UI.Page
{
public TextBox myTextBox;
Public TUserControl myUserControl..

it fail in compile time.

How can I do ?
Nov 17 '05 #1
2 1458
hi

you should be able to do so, My bet is that you forgot to reference the
assembly:

using MyAssembly;

what is the compiler error anyway?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OU***************@TK2MSFTNGP10.phx.gbl...
We can declarre a web controls in a class, like:

public class HealthClassBase: System.Web.UI.Page
{
public TextBox myTextBox;
.......
But if TUserControl is a Web UserControl.
When I declare it in a class like:

public class HealthClassBase: System.Web.UI.Page
{
public TextBox myTextBox;
Public TUserControl myUserControl..

it fail in compile time.

How can I do ?

Nov 17 '05 #2
hi

you should be able to do so, My bet is that you forgot to reference the
assembly:

using MyAssembly;

what is the compiler error anyway?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OU***************@TK2MSFTNGP10.phx.gbl...
We can declarre a web controls in a class, like:

public class HealthClassBase: System.Web.UI.Page
{
public TextBox myTextBox;
.......
But if TUserControl is a Web UserControl.
When I declare it in a class like:

public class HealthClassBase: System.Web.UI.Page
{
public TextBox myTextBox;
Public TUserControl myUserControl..

it fail in compile time.

How can I do ?

Nov 17 '05 #3

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

Similar topics

0
by: ad | last post by:
We can declarre a web controls in a class, like: public class HealthClassBase: System.Web.UI.Page { public TextBox myTextBox; ....... But if TUserControl is a Web UserControl. When I...
1
by: S Guiboud | last post by:
I want to subclass the System.Web.UI.UserControl to make a common control for my site. Then, when I create a new UserControl from the Visual Studio I changed the base class...
5
by: Jim Hubbard | last post by:
I have created a simple usercontrol that adds functionality to the webbrowser control (let's call it ctrl1). I would like to add it to another usercontrol I am creating (let's call it ctrl2), but...
2
by: mharness | last post by:
Hello, I've tried a number of examples showing how to read the properties of a user control from an aspx file where the code is on the html view of the form but I can't figure out how to read...
2
by: lotus | last post by:
HI All.. I'm realtively new to C#. I have MainForm which includes Parent usercontol, and this parent usercontrol also contains child usercontrol. MainForm --> Parent usercontrol --> child...
2
by: tbh | last post by:
hi, hope this cross-post is OK. it's unclear to me whether this question belongs more under vstudio or dotnet... i'm using VS2005 pro and am one co-developer of a web solution that is getting to...
5
by: billsahiker | last post by:
I saw one post here that basically said no way, but not sure which vs version was being discussed. Using vs 2005 I develped a user control in a vb project and would like to use that usercontrol in...
13
by: Screaming Eagles 101 | last post by:
Hi, I have a solution containing two projects - main project with main form containing a statusstrip - second project containing a usercontrol. I have added the usercontrol to my main form,...
2
by: Andrew Backer | last post by:
I hope someone out there can help me with this, because I am stuck. My problem is that I have an instance of a generic class, but I don't know ahead of time what the type parameter used was. In...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.