Logo Home   Documents & Lists   Site Settings   Help   
Icon
SharePoint Support
Common User Issues: Error: One of the properties of the Web Part...
   
Post Reply Post Reply
|
Edit Edit Message
|
Delete Delete Message
|
Alert Me
|
Go Back to Discussion Board
From:
Posted At: 4/15/2004 7:13 PM
Subject:
Error: One of the properties of the Web Part has an incorrect format.
Text:
Problem: Deploying a Web Part. In its default state it works great. If I change one of the properties using the "Modify Shared Web Part" menu and apply it, on my second refresh of the page I get the dreaeded:
Web Part Error: One of the properties of the Web Part has an incorrect format. Windows SharePoint Services cannot deserialize the Web Part. Check the format of the properties and try again.
Here's a snippit of my code (there are no other properties than what is shown here):
 
  private const string _defaultDetailPageUrl = "DetailReport.aspx";
  private const int _defaultHoursBackToLook = 48;
  private string _detailPageUrl;
  private int _hoursBackToLook;
  private System.Data.DataView _issueView;
 
  public LatestIssues()
  {
   _detailPageUrl = _defaultDetailPageUrl;
   _hoursBackToLook = _defaultHoursBackToLook;
  }
 
  [
  Browsable(true),Category("Miscellaneous"),
  DefaultValue(_defaultHoursBackToLook),
  WebPartStorage(Storage.Personal),
  FriendlyName("HoursBackToLook"),
  Description("The number of hours previous to now to look for submitted issues."),
  XmlElement(ElementName="HoursBackToLook")
  ]
  public int HoursBackToLook
  {
   get
   {
    return _hoursBackToLook;
   }
   set
   {
    if(value < 0)
     value = 48;

    _hoursBackToLook = value;
    this.BindData(); // Gets data from SQL Server and puts it in _issueView
    this.SaveProperties = true;
   }
  }
  [
  Browsable(true),Category("Miscellaneous"),
  DefaultValue(_defaultDetailPageUrl),
  WebPartStorage(Storage.Shared),
  FriendlyName("DetailPageUrl"),
  Description("The URL of the page that shows the report detail."),
  XmlElement(ElementName="DetailPageUrl")
  ]
  public string DetailPageUrl
  {
   get
   {
    return _detailPageUrl;
   }
   set
   {
    _detailPageUrl = value;
    this.SaveProperties = true;
   }
  }
 
 
Doug
Attachments:
 
 
Created at 4/15/2004 7:13 PM by
Last modified at 4/15/2004 7:13 PM by