我有一个旁边的标签<aside class="right-side"></aside>
,我正在用另一个页面的html填充它,如下所示:
function getContent(section) {
$.ajax({
cache: false,
type: "GET",
url: "getContent.ashx",
contentType: "text/html;charset=utf-8",
dataType: 'html',
data: { section: section, opId:<%= op.id%> },
success: function (response) {
$(".right-side").html(response);
}
});
}
并且getContent.ashx
正在发出webclient请求以显示如下页面:
WebClient c = new WebClient()
content = c.DownloadString("page2.aspx");
context.Response.Write(content);
我的问题是在page2.aspx中我添加了一个Updatepanel和计时器,但是它们没有工作且计时器没有触发,请注意,如果我直接运行页面而没有旁边的计时器触发器触发!
下面是更新面板
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<!-- your content here, no timer -->
</ContentTemplate>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
</asp:Timer>