WebPartManager.AddWebPart...not understanding exception

Discussion in 'ASP .Net' started by SlimFlem, Jan 6, 2006.

  1. SlimFlem

    SlimFlem Guest

    I am new to the WebPartManager stuff and am still learning how to set
    this up properly. I am creating instances of WebPart classes from
    loaded DLLs and add them to the Page's WebPartManager. If I don't have
    this property set on the WebPartManager:
    Personalization-Enabled="false", the page will hang and not load. If I
    do have this, then I get the following exception:

    ===

    System.InvalidOperationException was unhandled by user code
    Message="Personalization is not enabled and/or modifiable. The
    Enabled property must be set to true, and a registered personalization
    provider must be selected. The current user must be granted the right
    to modify personalization state."
    Source="System.Web"
    StackTrace:
    at
    System.Web.UI.WebControls.WebParts.WebPartPersonalization.EnsureEnabled(Boolean
    ensureModifiable)
    at
    System.Web.UI.WebControls.WebParts.WebPartManager.AddWebPart(WebPart
    webPart, WebPartZoneBase zone, Int32 zoneIndex)
    at BWC.PublicSite.WebSite.PageLoader.PageLoader_Load(Object
    sender, EventArgs e) in
    c:\code\BWC.PublicSite2\BWC.PublicSite.WebSite\Members\PageLoader.aspx.cs:line
    80
    at System.Web.UI.Control.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ===

    I thought a default PersonalizationProvider was provided for you by the
    WebPartManager and I did not need to create one.

    Why would my page hang when I do not have the above mentioned property
    on the WebPartManager?

    Thanks for any help.
    SlimFlem, Jan 6, 2006
    #1
    1. Advertising

  2. SlimFlem

    Joerg Jooss Guest

    Hello SlimFlem,

    > I am new to the WebPartManager stuff and am still learning how to set
    > this up properly. I am creating instances of WebPart classes from
    > loaded DLLs and add them to the Page's WebPartManager. If I don't
    > have this property set on the WebPartManager:
    > Personalization-Enabled="false", the page will hang and not load. If
    > I do have this, then I get the following exception:

    [...]
    > I thought a default PersonalizationProvider was provided for you by
    > the WebPartManager and I did not need to create one.
    >
    > Why would my page hang when I do not have the above mentioned property
    > on the WebPartManager?


    I struggled with this one as well.

    Is your web application set up for personalization? If not, this isn't going
    to work. The easiest way to do that (quick and dirty) is to disable anonymous
    access in IIS and enforce Windows Authentication, in which case personalization
    wll be based on your Windows account.

    For real world (internet) applications, you'll want to set up personalization
    with Forms Authentication like documented on MSDN.

    Cheers,
    --
    Joerg Jooss
    Joerg Jooss, Jan 7, 2006
    #2
    1. Advertising

  3. SlimFlem

    SlimFlem Guest

    To sum it up, all I want to do is, build a regular website that is
    browseable by everyone, does not have the requirement to ever enter
    edit mode, design mode, etc (at the moment). The pages are being built
    dynamically using a backend CMS system and various other "pieces" which
    are WebPart classes in separate DLLs, not the App_Data folder of the
    application.

    It does not make sense to me why MS assumes/forces you to use
    Personalization if you don't want/need it. Dynamically loading
    WebPart's should not be dependent on Personalization. What is the
    logic behind this decision?

    I have tried using a Windows account in IIS and disabling anonymous
    access and many variations of, but for the life of me, I cannot get
    past the exception I posted in my first post. It's about to drive me
    mad.
    SlimFlem, Jan 7, 2006
    #3
  4. SlimFlem

    SlimFlem Guest

    And also, I have properly setup the aspnetdb on a SQL Server 2000
    machine and set the proper connection string for it, but it's like it
    doesn't even exist when I attempt to run the application.
    SlimFlem, Jan 7, 2006
    #4
    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. =?Utf-8?B?U2hhdW4=?=

    WebPartManager Import method

    =?Utf-8?B?U2hhdW4=?=, Jul 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    =?Utf-8?B?U2hhdW4=?=
    Jul 27, 2005
  2. =?Utf-8?B?Q0JyZXRhbmE=?=

    Programattically control WebPartManager outside of ASP Page?

    =?Utf-8?B?Q0JyZXRhbmE=?=, Nov 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    349
    =?Utf-8?B?Q0JyZXRhbmE=?=
    Nov 16, 2005
  3. SlimFlem
    Replies:
    9
    Views:
    1,918
    SlimFlem
    Jan 9, 2006
  4. =?Utf-8?B?QmlsbCBNaWxk?=

    anonynousIdentification and WebPartManager

    =?Utf-8?B?QmlsbCBNaWxk?=, Feb 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,436
    =?Utf-8?B?RFdT?=
    Feb 14, 2006
  5. Replies:
    1
    Views:
    3,618
Loading...

Share This Page