Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 396951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:36:09+00:00 2026-05-12T16:36:09+00:00

We have a Sharepoint site which uses search. We get the following error: Unable

  • 0

We have a Sharepoint site which uses search.

We 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)

After a bit of testing we have found that the error occurs when we use DateKeyNames on a GridView control.

Not sure why there should be any combination between Search, this error and DataKeyNames.

Any ideas?

Update: Here is some code

[Guid("8891224e-e830-4ffa-afbd-f789583d8d14")]
    public class TestErrorGridView : System.Web.UI.WebControls.WebParts.WebPart
    {
        Control ascxToAdd;
        public TestErrorGridView()
        {
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

        }

        protected override void CreateChildControls()
        {


            base.CreateChildControls();
            Table test = new Table();
            TestBindObject t1 = new TestBindObject() { ID = 1, Name = "Test" };
            List<TestBindObject> l1 = new List<TestBindObject>();
            l1.Add(t1);
            SPGridView testGrid = new SPGridView() { AutoGenerateColumns = false};
            BoundField header = new BoundField();
            header.DataField = "ID";
            BoundField name = new BoundField();
            name.DataField = "Name";
            testGrid.Columns.Add(header);
            testGrid.Columns.Add(name);
            testGrid.DataSource = l1;
            testGrid.DataBind();
            // If you comment out this line search works
            testGrid.DataKeyNames = new string[] { "ID" };
            this.Controls.Add(testGrid);

            base.CreateChildControls();
            SPGridView testGrid = new SPGridView() { AutoGenerateColumns = false, EnableViewState=false };

            testGrid.DataKeyNames = new string[] { "testid" };  

            this.Controls.Add(testGrid);

        }
    }

public class TestBindObject
{
   public int ID { get; set; }
   public string Name { get; set; }
}

UPDATE

This error occurrs on the developer machines, so it is not realated to machine keys being different on different machines in a cluster.

One of the developers has MOSS installed, he does not get the error. The developers who have just WSS installed get the error.

UPDATE 2

Have added datasource to code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:36:09+00:00Added an answer on May 12, 2026 at 4:36 pm

    We eventually solved this by following the example in this link:

    http://msdn.microsoft.com/en-us/library/bb466219.aspx

    I think that is was binding to a data table rather than a list that made the difference.

    The fact that Sharepoint grids do not allow autogenerated columns appears to be one of the factors leading to this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a window application which uses SP classes to create a site. I
I have a SharePoint site extended for forms authentication. The Active Directory site is
We have a SharePoint Team Site (WSS 3.0 not MOSS), that includes Tasks list
I have a case where if a SharePoint site owner decides to break permissions
I have to call some code in a SharePoint site that runs under the
Background I have a massive db for a SharePoint site collection. It is 130GB
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application
I have some code that creates a new site in SharePoint. Upon browsing to
Does anybody know how to find offending web part which causes this error ?
I am forced to use SharePoint web services. I need a web service which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.