Professional Web Applications Themes

"Cannot Be Designed" error - ASP.NET General

Folks, I have a base page which is the grand-daddy of all my pages. It inherits from System.UI.Web.Page 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.Page I can't bring them up in the designer. This is a real ...

  1. #1

    Default "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.Page

    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.Page
    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



    Francis Shanahan Guest

  2. #2

    Default 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" <fsNoSpamPlease.francisshanahan.com> wrote in message
    news:#4wjehJRDHA.3880tk2msftngp13.phx.gbl...
    > Folks,
    > I have a base page which is the grand-daddy of all my pages. It
    inherits
    > from System.UI.Web.Page
    >
    > 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.Page
    > 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. Guest

  3. #3

    Default Re: "Cannot Be Designed" 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" <nattydao2com.com> wrote in message
    news:OvcpXCKRDHA.3144tk2msftngp13.phx.gbl...
    > 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 [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Francis Shanahan Guest

  4. #4

    Default Re: "Cannot Be Designed" 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.Page, I get the error "The base class
    "System.UI.Web.Page" cannot be designed. "

    Weird right?



    "William F. Robertson, Jr." <wfrobertsonkpmg.com> wrote in message
    news:OaaXPHLRDHA.2224TK2MSFTNGP12.phx.gbl...
    > VS 2002
    >
    > I see on your other post you are talking about applying security and
    stuff.
    > 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" <fsNoSpamPlease.francisshanahan.com> wrote in message
    > news:OrKKToKRDHA.1560TK2MSFTNGP12.phx.gbl...
    > > 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
    pages.
    > > The layout class itself inherits from the base page which is in a
    seperate
    > > 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
    clear
    > > this up.
    > > -fs
    > >
    > >
    > > "William F. Robertson, Jr." <wfrobertsonkpmg.com> wrote in message
    > > news:%23k$HEGKRDHA.1988TK2MSFTNGP12.phx.gbl...
    > > > 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" <fsNoSpamPlease.francisshanahan.com> wrote in
    > message
    > > > news:#4wjehJRDHA.3880tk2msftngp13.phx.gbl...
    > > > > Folks,
    > > > > I have a base page which is the grand-daddy of all my pages. It
    > > > inherits
    > > > > from System.UI.Web.Page
    > > > >
    > > > > 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.Page
    > > > > 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
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Francis Shanahan Guest

  5. #5

    Default Re: "Cannot Be Designed" 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" <fsNoSpamPlease.francisshanahan.com> wrote in message
    news:%234wjehJRDHA.3880tk2msftngp13.phx.gbl...
    > Folks,
    > I have a base page which is the grand-daddy of all my pages. It
    inherits
    > from System.UI.Web.Page
    >
    > 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.Page
    > 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
    >
    >
    >

    Eric Guest

  6. #6

    Default Re: "Cannot Be Designed" 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\Microsoft.NET\Framework\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" <fsNoSpamPlease.francisshanahan.com> wrote in message
    news:%234wjehJRDHA.3880tk2msftngp13.phx.gbl...
    > Folks,
    > I have a base page which is the grand-daddy of all my pages. It
    inherits
    > from System.UI.Web.Page
    >
    > 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.Page
    > 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
    >
    >
    >

    Francis Shanahan Guest

Similar Threads

  1. Replies: 0
    Last Post: October 18th, 09:19 PM
  2. "Error Creating Control" and "Cast from String"
    By Lisa in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 14th, 01:53 PM
  3. Acrobat Form Submit error: changes VALUE="true" to "0"
    By Douglas_Maus@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 1
    Last Post: August 12th, 05:25 PM
  4. #12029 [Com]: "--with-apxs" can cause the error "MySQL: Unable to save result set in"
    By sietzepost at streetwisedd dot nl in forum PHP Development
    Replies: 1
    Last Post: October 3rd, 09:21 AM
  5. Replies: 0
    Last Post: July 24th, 09:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139