The state information is invalid for this page and might be corrupted

26 06 2008

IN one of my project, I was getting this error in Mozilla Firefox only that whenever i clicked a button or link.

It is because of the fact that firefox caches the form fields. Two ways to encounter this problem.

1.Write following snipet in your cs file

protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
if (Request.Browser.MSDomVersion.Major == 0) // If it is Non IE Browser
{
Response.Cache.SetNoStore();
}
}

2. In page load, write following statemet

Response.Cache.SetNoStore();

Now error has been removed and you can sleep with satisfaction.

Muhammad Tahir Rauf.

Advertisements

Actions

Information

3 responses

25 07 2008
neha

hi
Thank a lot

Regards
Neha

6 02 2009
prateek

cheers,

that was good one. Saved my lot of time

25 02 2009
Ravi Lele

Dear Tahir,

I was googling around about the same problem last night,
fortunately got your page…
done changes according your suggesion, and tested on my end.

i will have to see it on web-server… HOPE it will work

Thanks, keep the good work up.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: