Friday, November 20, 2009

Querystring parameters you should not use in your SharePoint application

Today I have been working on a support case where customer experienced exceptions in sharepoint when passing in specific query string parameters which are evaluated by his web parts. The URL looked similar to this:

http://servername/Pages/MyPage.aspx?ID=<number>

The problem here is caused by the fact that the customer used a reserved query string parameter. When creating the SPContext object SharePoint evaluates the following query string parameters if provided:

  • FeatureId
  • ListTemplate
  • List
  • ID
  • VersionNo
  • ContentTypeId
  • RootFolder
  • View
  • FolderCTID
  • Mode
  • Type

To ensure that the creation of the SPContext object does not fail your application should ensure that your query string parameters are different from those listed above.

0 comments: