Reputation: 1365
This is what I did
Code:
using System.Web.UI;
using System.Web.UI.Adapters;
namespace eRecruitCore.Adapters
{
public class PageStateAdapter : PageAdapter
{
public override PageStatePersister GetStatePersister()
{
return new SessionPageStatePersister(this.Page);
}
}
}
In the browser added the following content. Named the file “Default.browser”
<browsers>
<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.Page" adapterType="Corelibrary.Adapters.PageStateAdapter" />
</controlAdapters>
<capabilities>
<capability name="requiresControlStateInSession" value="true" />
</capabilities>
</browser>
</browsers>
Ensured the adapterType attribute matches the class namespace that was created for Page State Adapter.
For some strange reason, this piece of code does not work in Chrome ONLY. When I say does not work, what I mean is, the page loads fine but the viewstate is the big gobbly mess that it is. However in IE and Firefox the view state is small and the page loads faster.
The next thing I did was to load the page in Fiddler under different user agents, if the user agent is chrome then the same mess of view state comes up.
I have checked the code multiple times, I wrote an example site to test. That is working fine on Chrome. I am really not sure where to look. Any help on this is appreciated.
Upvotes: 0
Views: 696
Reputation: 1365
I got this fixed. For an old issue the code was clearing all the adapters. I modified it so that fix cleared only those adapters that was needed. Now its working without issues.
Upvotes: 1