Hi. I'm sorry to post such a vague question, but I hope someone
can at least tell me where to start looking to narrow down the problem
I'm having.
I have code that moves a web part on a post back. It used to work
before so I'm not sure where the regression is (or if something changed
in the .NET framework with the RC0 release), but I'm getting the
following stack trace when I call WebPartManager.MoveWebPart():
[InvalidOperationException: 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.] System.Web.UI.WebControls.WebParts.WebPartPersonalization.EnsureEnabled(Boolean ensureModifiable) +145 System.Web.UI.WebControls.WebParts.WebPartManager.MoveWebPart(WebPart webPart, WebPartZoneBase zone, Int32 zoneIndex) +46 edu.depaul.cti.col.COLCoreWebControls.WebParts.COLWebPartZone.MinimizeWebPart(WebPart webPart) in C:\devroot\colweb2\ColWeb2\COLCoreWebControls\WebParts\COLWebPartZone.cs:103 edu.depaul.cti.col.COLCoreWebControls.WebParts.COLWebPartZone.RaisePostBackEvent(String eventArgument) in C:\devroot\colweb2\ColWeb2\COLCoreWebControls\WebParts\COLWebPartZone.cs:283 System.Web.UI.WebControls.WebParts.WebPartZoneBase.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
|
Version Information: Microsoft .NET Framework Version:2.0.50727.26; ASP.NET Version:2.0.50727.26
I've tried manually connecting to the personalization database with an
SqlConnection object using the query string that the Personalization
provider is using, and I can insert records into that database with an
SqlCommand object. This would indicate to me that there aren't
any problems actually connecting to the database.
When I look at the WebPartManager.Provider object in the debugger, it's
set to "Shared" scope. Now in my code I set the
WebPartManager.InitialScope to "User", but somewhere it gets
changed. I don't have any code in my project where I set it to
"Shared", so how would it be reverting back to "Shared"?
What else can I look for to see where this is going wrong? What
else could I be forgetting that I need to enable for web parts
personalization to work?
Thanks for any help!