468,110 Members | 1,867 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,110 developers. It's quick & easy.

Subclassing UserControl makes the Visual Studio designer does not work

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.
Nov 17 '05 #1
1 3165
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.
"S Guiboud" <sg************@ubi.com> wrote in message news:<02****************************@phx.gbl>...
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.

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by bill yeager | last post: by
2 posts views Thread by Benedict Teoh | last post: by
7 posts views Thread by Laurent Navarro | last post: by
3 posts views Thread by arncota | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.