"Cannot Be Designed" error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Francis Shanahan

    #1

    "Cannot Be Designed" error

    Folks,
    I have a base page which is the grand-daddy of all my pages. It inherits
    from System.UI.Web.P age

    From this I inherit a layout page.

    From this I inherit the individual pages themselves.

    The problem: My pages can no longer be brought up in the designer. I'm using
    Visual Studio 2002 and these pages are written in asp.NET with the code
    behinds in vb.NET.

    The ancestors are all just regular .vb classes with no visual components.
    Even when I switch my pages back to inherit directly from System.UI.Web.P age
    I can't bring them up in the designer. This is a real pain.

    Has anyone seen this?

    Will upgrading to Visual Studio 2003 fix the bug?

    Cheers,
    -fs



  • William F. Robertson, Jr.

    #2
    Re: "Cannot Be Designed" error

    That happens to me and my group from time to time. The only way we have
    found around it, is to close all .aspx pages, then studio, and reopen it.
    That usually fixes it.

    Now if you have the Web Control Library in the same solution I have to
    rebuild, then close (close all open pages first), then reopen, then rebuild,
    then open the problem pages. That usually fixes it.

    Don't know if upgrading will help you, but this usually corrects the problem
    for my group.

    HTH,

    bill

    "Francis Shanahan" <fs@NoSpamPleas e.francisshanah an.com> wrote in message
    news:#4wjehJRDH A.3880@tk2msftn gp13.phx.gbl...[color=blue]
    > Folks,
    > I have a base page which is the grand-daddy of all my pages. It[/color]
    inherits[color=blue]
    > from System.UI.Web.P age
    >
    > From this I inherit a layout page.
    >
    > From this I inherit the individual pages themselves.
    >
    > The problem: My pages can no longer be brought up in the designer. I'm[/color]
    using[color=blue]
    > Visual Studio 2002 and these pages are written in asp.NET with the code
    > behinds in vb.NET.
    >
    > The ancestors are all just regular .vb classes with no visual components.
    > Even when I switch my pages back to inherit directly from[/color]
    System.UI.Web.P age[color=blue]
    > I can't bring them up in the designer. This is a real pain.
    >
    > Has anyone seen this?
    >
    > Will upgrading to Visual Studio 2003 fix the bug?
    >
    > Cheers,
    > -fs
    >
    >
    >[/color]


    Comment

    • Francis Shanahan

      #3
      Re: &quot;Cannot Be Designed&quot; error

      Thanks for the response.
      In the Basepage, I apply security (enable/disable controls) to the controls
      array.
      In the Layout page, I remove all controls and add them back to the page
      along with the form tag. Fairly standard inheritance scheme.

      I've tried the suggestions, nothing seems to fix it.
      -fs


      "Natty Gur" <natty@dao2com. com> wrote in message
      news:OvcpXCKRDH A.3144@tk2msftn gp13.phx.gbl...[color=blue]
      > Hi,
      >
      > There isn't any problem with designer and creating your own base page
      > class. Your problem might be result from your code. Can you describe
      > what are you doing in your base page? Are you rendering anything?
      >
      > Natty Gur, CTO
      > Dao2Com Ltd.
      > 28th Baruch Hirsch st. Bnei-Brak
      > Israel , 51114
      >
      > Phone Numbers:
      > Office: +972-(0)3-5786668
      > Fax: +972-(0)3-5703475
      > Mobile: +972-(0)58-888377
      >
      > Know the overall picture
      >
      >
      > *** Sent via Developersdex http://www.developersdex.com ***
      > Don't just participate in USENET...get rewarded for it![/color]


      Comment

      • Francis Shanahan

        #4
        Re: &quot;Cannot Be Designed&quot; error

        I'm just enabling/disabling based on a cookie value in the basepage. I'm not
        attaching to a thread or any of that.

        Here's the thing that makes me think it's studio related: When I modify the
        page to inherit from System.UI.Web.P age, I get the error "The base class
        "System.UI.Web. Page" cannot be designed. "

        Weird right?



        "William F. Robertson, Jr." <wfrobertson@kp mg.com> wrote in message
        news:OaaXPHLRDH A.2224@TK2MSFTN GP12.phx.gbl...[color=blue]
        > VS 2002
        >
        > I see on your other post you are talking about applying security and[/color]
        stuff.[color=blue]
        > How are you doing it? In what method/event are you doing it on. It might
        > be trying to process the security code in the designer, and thus...wigging
        > out.
        >
        > bill
        >
        >
        > "Francis Shanahan" <fs@NoSpamPleas e.francisshanah an.com> wrote in message
        > news:OrKKToKRDH A.1560@TK2MSFTN GP12.phx.gbl...[color=green]
        > > Thanks for the response William. Unfortunately your suggestions haven't
        > > resolved my problem.
        > > Can you tell me which version of studio you're on?
        > > In my case, the layout class is in the same project as the regular[/color][/color]
        pages.[color=blue][color=green]
        > > The layout class itself inherits from the base page which is in a[/color][/color]
        seperate[color=blue][color=green]
        > > assembly, in a seperate solution entirely so the reference is just a DLL
        > > reference, not a project reference.
        > >
        > > any ideas you can throw out there are MUCH appreciated. I'd love to[/color][/color]
        clear[color=blue][color=green]
        > > this up.
        > > -fs
        > >
        > >
        > > "William F. Robertson, Jr." <wfrobertson@kp mg.com> wrote in message
        > > news:%23k$HEGKR DHA.1988@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
        > > > That happens to me and my group from time to time. The only way we[/color][/color][/color]
        have[color=blue][color=green][color=darkred]
        > > > found around it, is to close all .aspx pages, then studio, and reopen[/color][/color]
        > it.[color=green][color=darkred]
        > > > That usually fixes it.
        > > >
        > > > Now if you have the Web Control Library in the same solution I have to
        > > > rebuild, then close (close all open pages first), then reopen, then[/color]
        > > rebuild,[color=darkred]
        > > > then open the problem pages. That usually fixes it.
        > > >
        > > > Don't know if upgrading will help you, but this usually corrects the[/color]
        > > problem[color=darkred]
        > > > for my group.
        > > >
        > > > HTH,
        > > >
        > > > bill
        > > >
        > > > "Francis Shanahan" <fs@NoSpamPleas e.francisshanah an.com> wrote in[/color][/color]
        > message[color=green][color=darkred]
        > > > news:#4wjehJRDH A.3880@tk2msftn gp13.phx.gbl...
        > > > > Folks,
        > > > > I have a base page which is the grand-daddy of all my pages. It
        > > > inherits
        > > > > from System.UI.Web.P age
        > > > >
        > > > > From this I inherit a layout page.
        > > > >
        > > > > From this I inherit the individual pages themselves.
        > > > >
        > > > > The problem: My pages can no longer be brought up in the designer.[/color][/color][/color]
        I'm[color=blue][color=green][color=darkred]
        > > > using
        > > > > Visual Studio 2002 and these pages are written in asp.NET with the[/color][/color]
        > code[color=green][color=darkred]
        > > > > behinds in vb.NET.
        > > > >
        > > > > The ancestors are all just regular .vb classes with no visual[/color]
        > > components.[color=darkred]
        > > > > Even when I switch my pages back to inherit directly from
        > > > System.UI.Web.P age
        > > > > I can't bring them up in the designer. This is a real pain.
        > > > >
        > > > > Has anyone seen this?
        > > > >
        > > > > Will upgrading to Visual Studio 2003 fix the bug?
        > > > >
        > > > > Cheers,
        > > > > -fs
        > > > >
        > > > >
        > > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Eric

          #5
          Re: &quot;Cannot Be Designed&quot; error

          Are any of the properties in your base page class accessing stuff that
          relies on the page context (i.e. the Request or Response object,
          User.Identity, etc)? You mentioned using a cookie so that may be the case.
          That can cause a problem as VS.NET accesses all properties when opening the
          page in design view and throws an exception if you are doing stuff like
          that. The workaround is to check for a null context in the offending
          properties. For example:

          public string MyProperty
          {
          get
          {
          // This prevents an exception being reported in design view
          if(this.Context == null)
          return null;

          ... do stuff that accesses context-related data ...
          }
          }


          "Francis Shanahan" <fs@NoSpamPleas e.francisshanah an.com> wrote in message
          news:%234wjehJR DHA.3880@tk2msf tngp13.phx.gbl. ..[color=blue]
          > Folks,
          > I have a base page which is the grand-daddy of all my pages. It[/color]
          inherits[color=blue]
          > from System.UI.Web.P age
          >
          > From this I inherit a layout page.
          >
          > From this I inherit the individual pages themselves.
          >
          > The problem: My pages can no longer be brought up in the designer. I'm[/color]
          using[color=blue]
          > Visual Studio 2002 and these pages are written in asp.NET with the code
          > behinds in vb.NET.
          >
          > The ancestors are all just regular .vb classes with no visual components.
          > Even when I switch my pages back to inherit directly from[/color]
          System.UI.Web.P age[color=blue]
          > I can't bring them up in the designer. This is a real pain.
          >
          > Has anyone seen this?
          >
          > Will upgrading to Visual Studio 2003 fix the bug?
          >
          > Cheers,
          > -fs
          >
          >
          >[/color]


          Comment

          • Francis Shanahan

            #6
            Re: &quot;Cannot Be Designed&quot; error

            Thanks to all who responded.
            I believe I've traced the cause of my error to the reference path on the
            project.

            If I add the following path, I can no longer design inherited forms using
            visual studio 2002
            C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\

            If I remove this and hence roll back the default references to the v1.0 of
            the framework, all seems hunky dory. I've tried removing and adding this and
            it seems fairly consistent. I can only hope this is fixed by my upgrade of
            visual studio to 2003 as I'm using v1.1 features of drop down controls and
            also XSL apis have changed.

            -fs


            "Francis Shanahan" <fs@NoSpamPleas e.francisshanah an.com> wrote in message
            news:%234wjehJR DHA.3880@tk2msf tngp13.phx.gbl. ..[color=blue]
            > Folks,
            > I have a base page which is the grand-daddy of all my pages. It[/color]
            inherits[color=blue]
            > from System.UI.Web.P age
            >
            > From this I inherit a layout page.
            >
            > From this I inherit the individual pages themselves.
            >
            > The problem: My pages can no longer be brought up in the designer. I'm[/color]
            using[color=blue]
            > Visual Studio 2002 and these pages are written in asp.NET with the code
            > behinds in vb.NET.
            >
            > The ancestors are all just regular .vb classes with no visual components.
            > Even when I switch my pages back to inherit directly from[/color]
            System.UI.Web.P age[color=blue]
            > I can't bring them up in the designer. This is a real pain.
            >
            > Has anyone seen this?
            >
            > Will upgrading to Visual Studio 2003 fix the bug?
            >
            > Cheers,
            > -fs
            >
            >
            >[/color]


            Comment

            Working...