Anchor Tags That Runat Server Don't Perform AJAX Postbacks Inside Umbraco
When I run identical code in Umbraco and outside of Umbraco (in Visual Studio), it runs perfectly outside of Umbraco, but it fails inside of Umbraco. It is a list of <a> tags with runat="server" that are inside of an update panel. They are supposed to cause an AJAX postback, but they instead cause a full page postback. And this seems to be specific to Umbraco. Here's my Umbraco template:
<%@ Master Language="VB" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then lvRecents.DataSource = New List(Of String)() From {"a", "b", "c"} lvRecents.DataBind() End If End Sub
Protected Sub recentItem_Click(sender As Object, e As EventArgs) System.Threading.Thread.Sleep(5000) lblDate.Text = DateTime.Now.ToString() upRecents.Update() End Sub </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Anchor Postbacks</title> </head> <body> <form id="frmMain" runat="server"> <asp:ScriptManager runat="server" ID="mainMan" EnablePartialRendering="true" /> <%-- Write a bunch of line breaks so we can observe postback-induced scrolling. --%> <% For i As Integer = 0 To 100%> <br /> <% Next%>
And here's my masterpage (that runs fine outside of Umbraco in Visual Studio), the only difference being the MasterPageFile:
<%@ Page Language="vb" MasterPageFile="Default.Master" AutoEventWireup="true" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then lvRecents.DataSource = New List(Of String)() From {"a", "b", "c"} lvRecents.DataBind() End If End Sub
Protected Sub recentItem_Click(sender As Object, e As EventArgs) System.Threading.Thread.Sleep(5000) lblDate.Text = DateTime.Now.ToString() upRecents.Update() End Sub </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Anchor Postbacks</title> </head> <body> <form id="frmMain" runat="server"> <asp:ScriptManager runat="server" ID="mainMan" EnablePartialRendering="true" /> <%-- Write a bunch of line breaks so we can observe postback-induced scrolling. --%> <% For i As Integer = 0 To 100%> <br /> <% Next%>
Note that I tried removing the xhtmlConformance element from the web.config, but that didn't help. Note also that I was able to solve the problem using RegisterAsyncPostBackControl, but that caused an additional problem that UpdateProgress controls don't run when their AssociatedUpdatePanelID attribute is set. Any ideas what could be causing this behavior in Umbraco (that is, full page postbacks rather than AJAX postbacks)? Any fixes?
Note: I'm on Umbraco 4.7.1. And ASP.NET 4.0. Chrome browser. You can notice the full page postback by the progress bar in the browser tab title and by the fact that the page scrolls to the beginning of the document on postback.
Anchor Tags That Runat Server Don't Perform AJAX Postbacks Inside Umbraco
When I run identical code in Umbraco and outside of Umbraco (in Visual Studio), it runs perfectly outside of Umbraco, but it fails inside of Umbraco. It is a list of <a> tags with runat="server" that are inside of an update panel. They are supposed to cause an AJAX postback, but they instead cause a full page postback. And this seems to be specific to Umbraco. Here's my Umbraco template:
And here's my masterpage (that runs fine outside of Umbraco in Visual Studio), the only difference being the MasterPageFile:
Note that I tried removing the xhtmlConformance element from the web.config, but that didn't help. Note also that I was able to solve the problem using RegisterAsyncPostBackControl, but that caused an additional problem that UpdateProgress controls don't run when their AssociatedUpdatePanelID attribute is set. Any ideas what could be causing this behavior in Umbraco (that is, full page postbacks rather than AJAX postbacks)? Any fixes?
Note: I'm on Umbraco 4.7.1. And ASP.NET 4.0. Chrome browser. You can notice the full page postback by the progress bar in the browser tab title and by the fact that the page scrolls to the beginning of the document on postback.
To answer myself, this appears to be fixed in the latest version of Umbraco (4.11.3.1). Either that, or there was a web.config difference.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.