I'm doing some tutorials on ASP.NET AJAX. I'm trying to do partial page refreshes with the AsyncPostBackTrigger and it is not working. It continues to refresh the entire page. (code below)
I am hosting this test site on my personal server which is running Ubuntu Linux 11.xx, with mono XSP2.
It seems as though there's a server setting that's not set or something but I checked the web.config file and everything appeared to be normal.
<!DOCTYPE html PUBLIC "-W3c//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-transitional.dtd">
<script runat="server" language="C#" >
protected override void onload(EventArgs e){
base.onload(e);
string theTime = DateTime.Now.ToLongTimeString();
for (int i = 0; i < 3; i++){
theTime += "<br />" + theTime;
}
time1.Text = theTime;
time2.Text = theTime;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Triggers</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Button ID="Button1" runat="server" Text="Update One" />
<asp:Button ID="Button2" runat="server" Text="Update the other" /><br /> <br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<ContentTemplate>
<div style="border-style:solid;background-color:gray;">
<asp:Label runat="server" ID="time1"></asp:Label><br />
</div><br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
</Triggers>
<ContentTemplate>
<div style="border-style:solid;background-color:green;" >
<asp:Label runat="server" ID="time2"></asp:Label><br />
</div><br />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
I've also confirmed that:
<system.web>
<xhtmlConformance mode=”Legacy” />
</system.web>
is not the problem in my web.config file
This post has been edited by Btu: 14 July 2011 - 02:32 PM

New Topic/Question
Reply



MultiQuote





|