In my ASP.NET Website, I am trying to use Server.Transfer to redirect client to different url(all pages resides in same domain) instead of using Response.Redirect because of performance issue and heavy flickering. But when I use Server.Transfer, all session values are wiped out and getting NullReference error even though if I enable page level EnableSessionState. After several attempt, i tried Context.ReWritepath just to change the url and lost all masterpage contents like menus, headers. Any idea? Any help? Am i doing anything wrong?
1 Answers
0
votes
This technique is great for wizard-style input forms split over multiple pages. But there's another thing you'll want to watch out for when using the preserveForm
parameter. ASP.NET has a bug whereby, in certain situations, an error will occur when attempting to transfer the form and query string values. You'll find this documented at
The unofficial solution is to set the enableViewStateMac
property to True
on the page you'll be transferring to, then set it back to False
. This records that you want a definitive False
value for this property and resolves the bug.