开发者

Error Modifying MOSS web part

Whenever I try to edit the shared properties of my custom web part in sharepoint 2007, I get the following error:

Exception has been thrown by the target of an invocation.
  at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at Microsoft.SharePoint.WebPartPages.ExtendedPropertyInfo.GetValue(Object target, Object[] indexValues)
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty.get_Value()
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty.get_IsNull()
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty..ctor(WebPart targetWebPart, SPWebPartManager webPartManager, PropertyInfo pi)
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperties.GetProperties(WebPart targetWe开发者_如何学GobPart, SPWebPartManager manager, Boolean inPersonalizationMode, IPropertySheetPropertiesFilter filter)
  at Microsoft.SharePoint.WebPartPages.CustomPropertyToolPart.CreatePropertyGrid()
  at Microsoft.SharePoint.WebPartPages.CustomPropertyToolPart.CreateChildControls()
  at System.Web.UI.Control.EnsureChildControls()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I do have some custom properties in my web part, which set the email addresses for notification emails that are generated by the form. An example of this is:

    [WebBrowsable(true),
    Personalizable(true),
    DefaultValue("myemail@company.com"),
    Category("Email Properties"),
    Microsoft.SharePoint.WebPartPages.WebPartStorage(Microsoft.SharePoint.WebPartPages.Storage.Shared),
    Microsoft.SharePoint.WebPartPages.FriendlyName("Email Addresses (separate multiple emails with a comma):"),
    Description("Please enter the email addresses for those that should be notified when an incident takes place at a Corporate location.")]
    public string CorpMessageEmailAddresses { get; set; }

However, even with these properties commented out, I still get an error when trying to modify the web part.

Has anyone else ever dealt with an issue like this? I can provide more information or code snippits, if needed.


Ok, I figured this out late last night...it was a typical MS exception hidden within an exception. The exception shown was not the cause, but rather the last exception to occur. The real exception was an issue having to do with my ViewState variables. I put a try/catch around the get & set and now everything works well!

I didn't see your comments until this morning kbrimington...thanx for trying to help out!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜