ASP.NET Error – The state information is invalid for this page and might be corrupted

I ran into this error a second time in the last couple of years and totally forgot how I fixed it, so i’ll blog what my situation and resolution was as a reminder and hopefully to help others.

I have an ASP.NET “default.aspx” page with a form text field with

tags in it. Then i’m making a jQuery (ajax) load function call to another page called “page2.aspx” with
tags in it.

So while on “default.aspx” when I submit my form I get this error: “The state information is invalid for this page and might be corrupted”.

The cause of this is because my “page2.aspx” also has

tags in it, so just remove them and you’re good!
[del.icio.us] [Digg] [Facebook] [LinkedIn] [MySpace] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]

Popularity: 6% [?]

Read More

Allowing Personalization in SharePoint 2010

SharePoint personalization allows users a level of customization by adding or removing web parts to their page. To test this you should have two different user accounts. Here are steps I took to get this working:

1. Open up SharePoint Designer 2010 and edit a page layout that has web part zones like “BlankWebPartPage.aspx”.
2. Locate the “ 3. Make sure your SharePoint test page is using the layout page with web part zones set with “AllowPersonalization=true”.
4. Logged in as the current user, click on the username in the top right corner and select “Personalize this page”.
5. Add 1 or 2 web parts which will only be visible to this current user, let’s call this “User A”. Save and publish this page if necessary.
6. Next login as “User B” and you shouldn’t see the web part(s) for “User A”. You can click on the top right username again and select “Personalize this page”.
7. Add a web part only visible for “User B”. Save and publish again.
8. The bottom line is that both users will have their own custom personalized page.

[del.icio.us] [Digg] [Facebook] [LinkedIn] [MySpace] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]

Popularity: 3% [?]

Read More

SharePoint 2010 spscore PlaceHolderPageTitle PageParserPath Bug

Actually not sure if this is a bug or whatever, but whenever we take a copy of a MySite masterpage in SharePoint 2010 and make our own copy of it we get this error about the PlaceHolderPageTitle and spscore. Don’t quite remember how we figured this out but I couldn’t find much googling or binging.

To fix this, you need to go into your SharePoint 2010 MySite web.config and replace the existing

1
<pageparserpaths></pageparserpaths>

with the PageParserPath to your MySite masterpage as shown below:

1
2
3
<pageparserpaths>
        <pageparserpath VirtualPath="/my/_catalogs/masterpage/New_MySite.master" CompilationMode="Always" AllowServerSideScript="true" />
      </pageparserpaths>
[del.icio.us] [Digg] [Facebook] [LinkedIn] [MySpace] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]

Popularity: 47% [?]

Read More

Upgrading A SharePoint WSP With A New Feature

I know this post is very specific, i’ll go into how to create a WSP from scratch, how to build specific features, etc. in future posts. In this scenario, you have an existing WSP project and added a new feature that creates a link in the Site Settings section called Awesome Link, also assume we used WSP Builder to build a nice WSP file for you, let’s call this file AwesomeLink.wsp

Step 1

This is easy, just copy AwesomeLink.wsp to a folder on your SharePoint server. We’ll call this folder c:\projects\WSPs

Step 2

Now we will use STSADM to upgrade the solution by opening up a Command Prompt, one of the quickest ways to do this is to click on Start > Run, then type in CMD and press OK.

Next navigate to the folder where you copied over the AwesomeLink.wsp file, in this case it’s c:\projects\WSPs

Step 3

Type this first command and press the Enter key:
stsadm -o upgradesolution -filename "AwesomeLinks.wsp" -name "AwesomeLinks.wsp" -immediate -allowgacdeployment

Then type the second command and press Enter:
stsadm -o installfeature -name "AwesomeLink" -force

Step 4

Next go to your SharePoint site and click on Site Actions > Site Settings > Modify All Site Settings
Click on Site Collection Features link located under the Site Collection Administration group.

That’s It!

You’re all done upgrading a SharePoint WSP, go take a break or play some Xbox 360!

[del.icio.us] [Digg] [Facebook] [LinkedIn] [MySpace] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]

Popularity: 39% [?]

Read More

Test IE6 On A Free Virtual PC Image

I’m sure like everyone else you wish IE6 would just go away which it eventually will. The hate for IE6 has gone as far as dedicated websites such as IE Death March and wallpaper However in the meantime if you need to test on IE6 there are a few ways this can be done:

  • Run Xenocode IE6 Browser emulator
  • Install Tredosoft’s MultipleIE
  • Visit Browsershots.org
  • Or just remote into a server running IE6
  • Today I’m going to show you an alternative method testing IE6 in the most accurate manner possible, using a Virtual Machine:

    1. First download VPC (Virtual PC) if you don’t already have it
    2. Then install IE6-XPSP3.exe which is a VPC disk image for testing in a native IE environment.
    3. After you get this image up and running, if you start running Windows Update be sure not to install IE8 :)
    [del.icio.us] [Digg] [Facebook] [LinkedIn] [MySpace] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]

    Popularity: 62% [?]

    Read More

    Using MySpace REST API with OAuth and C#

    In this example we will make a REST call to MySpace, get back 100 of our friends and display them on a web page. Because we’re accessing personal private information, you need to pass some authorization parameters with your REST call, and MySpace has adapted the OAuth authorization standard. Before I start explaining more about the code, make sure you already have a MySpace account, then follow the next few steps:

    1. Go to: http://developer.myspace.com/ and
    2. Click on Build on the top nav.
    3. Select Create on-site app button, and fill out your app info.
    4. When you get to the section for upload app xml, click on skip this step.
    5. Make a note of your OAuth Consumer Key and OAuth Consumer Secret because you will need it later.
    6. Under the Canvas Surface tab, select External IFrame option.
    7. Then you have to add the app, otherwise you may get 401 access denied error attempting to make a request.

    Okay, hit save and you should be good for now. Let’s open up Visual Studio 2008 and begin!

    1. Create a Website called MySpaceApp or whatever you want.
    2. Copy this file OAuthBase.cs into your project
    3. Add using OAuth namespace at the top of Default.cs
    4. Declare variables for your consumer key, consumer secret and request server:
      1
      2
      3
      4
      5
      
      <code>
      protected string consumerKey = "http://www.myspace.com/123456789";
              protected string consumerSecret = "12abcd345678efghi90jk";
              protected string requestServer = "http://api.myspace.com";
      </code>
    5. Create a public MakeRequest() method returning a DataSet.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      
      <code>
      public DataSet MakeRequest(string restCall)
              {
                  // Form the full REST request url
                  Uri url = new Uri(requestServer + restCall);
                  DataSet ds = new DataSet();
       
                  // Instantiate OAuthBase and declare variables
                  OAuthBase oAuth = new OAuthBase();
                  string nonce = oAuth.GenerateNonce();
                  string timeStamp = oAuth.GenerateTimeStamp();
                  string normUrl = string.Empty;
                  string normParams = string.Empty;
                  string strRequest = string.Empty;
       
                  // Create an OAuth signature
                  string signature = oAuth.GenerateSignature(url,
                      consumerKey, consumerSecret, string.Empty, string.Empty,
                      "GET", timeStamp, nonce, OAuth.OAuthBase.SignatureTypes.HMACSHA1,
                      out normUrl, out normParams);
       
                  // Construct the OAuth authenticated REST url
                  strRequest = normUrl + "?" + normParams + "&" + UrlEncode("oauth_signature") + "=" + UrlEncode(signature);
       
                  return MakeWebRequest(strRequest);
              }
      </code>
    6. Next create a MakeWebRequest() method returning a DataSet
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      
      <code>
      protected DataSet MakeWebRequest(string restCall)
              {
                  // Make web request
                  HttpWebRequest request = WebRequest.Create(restCall) as HttpWebRequest;
                  using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
                  {
                      // In this example we are getting back XML
                      XmlTextReader xReader = new XmlTextReader(response.GetResponseStream());
       
                      DataSet ds = new DataSet();
                      ds.ReadXml(xReader);
                      xReader.Close();
       
                      return ds;
                  }
              }
      </code>
    7. Finally create a GetFriendList() method that will make the REST request and bind it to a Repeater displaying all your friends.

      1
      2
      3
      4
      5
      6
      7
      
      <code>
          protected void GetFriendList()
          {
              rptFriends.DataSource = fb.MakeRequest("/v1/users/YOUR_USER_ID/friends.xml?page_size=100");
              rptFriends.DataBind();
          }
      </code>
    8. I also built this REST Test Tool that uses OAuthBase.cs that will help you create sample REST calls so you can validate the OAuth parameters.
    [del.icio.us] [Digg] [Facebook] [LinkedIn] [MySpace] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]

    Popularity: 100% [?]

    Read More