|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WebPartManager.AddWebPart...not understanding exceptionthis 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. Hello SlimFlem,
> I am new to the WebPartManager stuff and am still learning how to set I struggled with this one as well. > 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? 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 news-re***@joergjooss.de 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.
Other interesting topics
Books on ASP.net 2.0
serialized binary files vs Sql Server Performance.. Book Recommendation 2.0 binding ObjectDataSource to Dataset Using RSS Moving an XML node up or Down .NET controls rendering Accessing GAC classes from a WebService? Why Publish take so long? Apply new MasterPage to an existing page |
|||||||||||||||||||||||