Can't declare a usercontrol in a Class

A

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 ?
 
I

Ignacio Machin \( .NET/ C# MVP \)

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,
 

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

Top