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.