2

In SharePoint 2010 I'm getting a strange behavior. I have a custom content page with some custom web parts and some XsltListViewWebParts. I'm identifying a single entity by passing its id through the query string. But it appears that when "?Id=x" exists in the querystring of any page in SharePoint 2010 several buttons in the ribbon for list view web parts get disabled.

To test this out go to any page in a SharePoint 2010 site that lists multiple list items. Select several list items via the floating checkboxes. Confirm that a delete button is enabled. Add "?Id=x" to the query string. Select several list items. Confirm that the delete button is now disabled.

Anyone else getting this behavior? Is it a bug? Is it by design? I guess I can change my code around to call my parameter something else, but this seems like pretty bizarre behavior.

1
  • Is there a solution to this problem? We're using two date parts, parameters and filters (with a listview) and all items display correctly. But, the ribbon view/edit options are disabled. This seems to be about 2yrs old... Any fix?
    – user6830
    Feb 9, 2012 at 19:15

3 Answers 3

2

The behaviour you describe does not only occur in the situation you describe.

Another test: Open a SharePoint list with items. Add ?id=3 to the query string. Select one item which id is not equal to three: delete button is disabled. When you select an item with id is 3 and with ?id=3 in the query string, the Delete button is enabled.

Based on this test I guess SharePoint uses the id internal when selecting an item/items from the list. When the id of the selected item does not match the id in the query string buttons which interact with a single item are not enabled.

When checking the core.js file on the definition of the delete item function the id is used definitely. In the core.js the definitions of the functions behind the button are listed, but not the code which enables or disables the button. So I can't check this.

Treat the id as reserved word, you are free to use something else.

Regards, Anita

2

It might be related to this (reported, confirmed and still unfixed problem): http://www.wictorwilen.se/Post/SharePoint-2010-Wiki-Pages-displays-the-wrong-content-when-passing-Query-String-parameters.aspx

0

Had a similar issue a while back. Golden rule is do not use "ID" in you custom code to identify anything in your query string. It is part of some deep dark SharePoint mojo and should be considered a system keyword. You'll want some other identifier in your query string like myID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.