User Control and VS design time issues

M

Munish Sethi

I have a User Control with a Code behind class.

If the Code behind class inherits from UserControl class there are no
problems within VS 2003, I can double click on the User Control (in VS
2003 solution explorer) and bring it up without getting any warnings in
VS Design time environment.

If, however the Code behind class inherits from another class (say
MyClass1), which in turn inherits from UserControl class, I get the
following warning in VS 2003 designer when I try to bring up the User
Control in VS design environment

---------------------------
Microsoft Development Environment
---------------------------
The file could not be loaded into the Web Forms designer. Please correct
the following error and then try loading it again:

Type Abstract

Make sure all of the classes used in the page are built or referenced in
the project. Click Help for more information.
---------------------------
OK Help

Basically I have a bunch of User Controls, all of which inherit from a
Base Class, the Base Class in turn Inherits class UserControl.
Application works no problem, however the design time experience is
lacking. I am unable to display the User Control in the "Design" tab
inside VS 2003; after the warning is displayed I can see my control in
HTML mode only.


Any pointers on how to overcome this issue?

Regards

Munish


<b> Munish </b>
 
N

Nicole Calinoiu

Munish,

The VS.NET 2002 designer can't deal with an abstract base class for a user
control. You should be able to load your ascx page in the designer if you
remove the abstract keyword from the declaration of the base class.

HTH,
Nicole
 
M

Munish Sethi

Nicole,

Thanks for the reply.

Yes,

It was declared as abstract, and I did make the modification for it NOT
to be abstrat however still no luck.

Here is the current situation

User Control look like

<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="CategoriesDetail.ascx.vb"
Inherits="UserInterface.CategoriesDetail" %>

Code Behind file looks like

Namespace UserInterface
Public Class CategoriesDetail
Inherits BaseDetail
...
End Class
End Namespace


Base Class look like

Namespace UserInterface
Public Class BaseDetail
Inherits System.Web.UI.UserControl
...
End Class
End Namespace


Munish
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top