Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy doesn't AJAX UpdatePanel work in ASP.NET 2.0 Web Site template?
    primarykey
    data
    text
    <p>I'm just getting into AJAX (little late I know) and am walking through some of the tutorials on the ASP.NET/AJAX site. One thing I've noticed is that I cannot get the UpdatePanel to work in the ASP.NET Web Site template. I can use the EXACT same markup, code, and web.config in the AJAX 1.0-Enabled ASP.NET 2.0 template and everything works as expected.</p> <p>Markup:</p> <pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;asp:ScriptManager EnablePartialRendering="true" ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt; &lt;div&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:Label ID="Label1" runat="server" /&gt;&lt;br /&gt; &lt;asp:Button ID="Button1" runat="server" Text="Update Both Panels" OnClick="Button1_Click" /&gt; &lt;asp:Button ID="Button2" runat="server" Text="Update This Panel" OnClick="Button2_Click" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:Label ID="Label2" runat="server" ForeColor="red" /&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Code:</p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToLongTimeString(); Label2.Text = DateTime.Now.ToLongTimeString(); } protected void Button2_Click(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToLongTimeString(); } </code></pre> <p>I'll post the web.config if needed, but again, they are exactly the same (copy pasted). ANy help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload