Subclassing UserControl makes the Visual Studio designer does not work

Discussion in 'ASP .Net' started by S Guiboud, Jul 17, 2003.

  1. S Guiboud

    S Guiboud Guest

    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.
     
    S Guiboud, Jul 17, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message news:<022c01c34c8d$079c7660$>...
    > 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.
     
    Ross Dempster, Jul 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wh
    Replies:
    2
    Views:
    601
    Cowboy \(Gregory A. Beamer\)
    Jan 16, 2004
  2. Ben Fidge
    Replies:
    0
    Views:
    1,834
    Ben Fidge
    Feb 26, 2006
  3. Thirumalai
    Replies:
    0
    Views:
    754
    Thirumalai
    May 22, 2006
  4. rockdale
    Replies:
    1
    Views:
    697
    Juan T. Llibre
    Aug 23, 2006
  5. WT

    Does visual studio designer supports iframe

    WT, May 15, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    443
    Walter Wang [MSFT]
    May 19, 2006
Loading...

Share This Page