Subclassing UserControl makes the Visual Studio designer does not work

S

S Guiboud

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 System.Web.UI.UserControl to my UserControl class
(a.k.a MyUserControl).
MyUserControl is only a .cs file with a class inheriting
from System.Web.UI.UserControl.
But, when I try to view the control in the Visual Studio
designer it always pop me a window asking me if I want to
reload the file and after :
"The file failed to load in the Web Form designer. Please
correct the following error, then load it again: Type
Abstract".

Here is my base class for all my UserControl :

public class MyUserControl : System.Web.UI.UserControl
{
MyUserControl()
{
}
}

Thanks in advance for any help.
 
R

Ross Dempster

I was getting this problem as well. Unfortunately I cannot remember
exactly what the problem is.

However, I do remember that you need to build the solution - this is
because the visual designer is trying to create an instance of your
class.

Sorry if that doesn't solve it,
but i thought i should mention it.
Ross.
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top