Subclassing UserControl makes the Visual Studio designer does not work

  • Thread starter Thread starter S Guiboud
  • Start date Start date
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.
 
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.
 
Back
Top