We are upgrading our code from .Net 3.5 to 4.0 and an issue has come up. The way we previously did login is now having an error on the Response.Redirect. From what have found doing research, it seems to be an error that has something to do with Ajax, adding to the response, and redirect. Unfortunately I can not find a solution to this problem.
The error we get is "Uncaught Sys.WebForms.PageRequestManagerParserErrorException" via the javascript from Telerik.Web.UI.WebResource.axd.
The code snippets we have below work under .Net 3.5 but do not work after attempting the 4.0 upgrade. The authentication cookies do get added as I can manually type the url that we are supposed to redirect to. However, the automatic redirect does not work.
The error we get is "Uncaught Sys.WebForms.PageRequestManagerParserErrorException" via the javascript from Telerik.Web.UI.WebResource.axd.
The code snippets we have below work under .Net 3.5 but do not work after attempting the 4.0 upgrade. The authentication cookies do get added as I can manually type the url that we are supposed to redirect to. However, the automatic redirect does not work.
<%@ Page Language="C#" MasterPageFile="~/masterpages/WebMain.master" AutoEventWireup="true" Inherits="Default" Codebehind="Default.aspx.cs"%>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
Runat
=
"Server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolderMaster"
Runat
=
"Server"
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"Login"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Login"
LoadingPanelID
=
"AjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"AjaxLoadingPanel1"
runat
=
"server"
/>
<
div
id
=
"divLogin"
runat
=
"server"
>
<
table
align
=
"center"
>
<
tr
>
<
td
align
=
"center"
>
<
asp:Login
ID
=
"Login"
runat
=
"server"
OnAuthenticate
=
"Login_Authenticate"
DisplayRememberMe
=
"False"
Orientation
=
"Horizontal"
TextLayout
=
"TextOnTop"
TitleText
=
""
LoginButtonStyle-Height
=
"25px"
LoginButtonStyle-Width
=
"50px"
>
</
asp:Login
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
asp:Content
>
protected
void
Login_Authenticate(
object
sender, AuthenticateEventArgs e)
{
...
Response.Cookies.Add(authCookie);
...
Response.Redirect(pageUrl,
false
);
}