Error viewing on a page of native SharePoint site using SPGridView

I have a custom site page in Windows SharePoint Services 3.0 that contains an SPGridView. When I use the search box on this page, I get the following error:

Unable to validate data.   at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) 
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)  

      

Removing the SPGridView from the page fixes this issue, but otherwise I'm not sure how to fix the problem.

This is a new default WSS3 installation, so I don't think it is related to any other settings (master pages, etc.). I have another custom site page in this function (which does not include an SPGridView), but I can use the search box on that page without throwing an error.

0


source to share


3 answers


OK, I finally figured out what the problem is (anyway): I was specifying the DataKeyNames attribute in the SPGridView. After removing this attribute, the search worked fine.



+1


source


Does the application work in a webfarm environment?
If so, the machineKey file should be set in web.config:
We are using the machineKey generator from eggheadcafe
Read more about Viewstate and webfarms here



0


source


Search in SharePoint appears to use hidden fields at the bottom of the master page.
   <input type = "text" name = "__ spDummyText1" style = "display: none;" size = 1 / ">
   <input type =" text "name =" __ spDummyText2 "style =" display: none; "Size = 1 /"> So if you've done anything with these fields in application.master or in the Utility content store, it won't work.
On the other hand, we used SPGridView in our pages without any problems.

0


source







All Articles