I have a page with an update panel that contains a few buttons that need to be able to redirect to another page. The script manager is located on a master page.
Every time one of those buttons are clicked, i get one of two errors:
-
If the button is inside of a gridview, i get this error:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
-
If the button is NOT inside of a gridview, i get this error:
Sys.WebForms.PageRequestManagerParserErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 302
Here's a test aspx page that I set up:
1 <%@ Page Language="VB" title="Untitled Page" MasterPageFile="~/main.master" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
2 <%@ Register Assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Web.UI" TagPrefix="ajax" %>
3 <asp:Content ID="Content1" ContentPlaceHolderID="plhContent" Runat="Server">
4 <ajax:UpdatePanel runat="server">
5 <ContentTemplate>
6 <asp:Label runat="server" ID="lblTime" /><br />
7 <asp:Button runat="server" ID="btnRefresh" Text="Refresh" /><br />
8 <asp:Button runat="server" ID="btnRedirect" Text="Redirect" /><br />
9 <asp:LinkButton runat="server" ID="lnkRedirect" Text="ASP Linkbutton" /><br />
10 <a href="http://www.google.com/" title="test redirect">HTML Hyperlink</a>
11 </ContentTemplate>
12 </ajax:UpdatePanel>
13 </asp:Content>
And here's the codebehind:
1 Partial Class test
2 Inherits System.Web.UI.Page
3
4 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
5 lbltime.Text = now()
6 End Sub
7
8 Protected Sub btnRedirect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRedirect.Click
9 Response.Redirect("http://www.google.com/", True)
10 End Sub
11
12 Protected Sub btnRefresh_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
13 lblTime.Text = Now()
14 End Sub
15
16 Protected Sub lnkRedirect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkRedirect.Click
17 Response.Redirect("http://www.google.com/", True)
18 End Sub
19 End Class
The LinkButton causes the same error, so it's not just limited to the button control. It looks like it affect anything that posts back to the server and causes a redirect.
Thanks for any help you can give me!