blog.dennus.net A reflection on Microsoft Office SharePoint Server 2007 (and other stuff…)

1Jul/090

Invalide parameter: ContentType. Expect a number. ‘SomeContentType’ is given instead.

So, you've created your custom advanced search box for your SharePoint 2007 site, but now you're running into an error:

Invalide parameter: ContentType. Expect a number. 'SomeContentType' is given instead.

There is a good chance you forgot to include two imporant hidden fields in your control:

  • ASB_TextDT_Props
  • ASB_DateTimeDT_Props

I'm not entirely sure about the purpose of these fields, but I suspect that the entries in these fields define the data type of the property fields in the advanced search box. You can include them in your control like this:

protected override void OnPreRender(EventArgs e) 
{ 
  base.OnPreRender(e);     
 
  this.Page.ClientScript.RegisterHiddenField("ASB_TextDT_Props", "ContentType#;#Path#;#FileName#;#Description#;#Title#;#Author#;#DocSubject#;#DocKeywords#;#DocComments#;#Manager#;#Company#;#CreatedBy#;#ModifiedBy");
  this.Page.ClientScript.RegisterHiddenField("ASB_DateTimeDT_Props", "Write#;#Created#"); 
}

Also, be sure to include any custom managed properties you might have and wish to search on.

Share and Enjoy:
  • StumbleUpon
  • Print
  • del.icio.us
  • Facebook
  • Twitter
  • Digg
  • Sphinn
  • Google Bookmarks
Filed under: MOSS 2007 Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.