【发布时间】:2011-07-22 19:43:23
【问题描述】:
通过计时器加载更新面板后,我无法从更新面板发出任何异步请求。
示例aspx代码:
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%--The Timer that causes the partial postback--%>
<asp:Timer runat="server" Interval="100" OnTick="Timer_Tick" Id="Timer1"/>
<asp:ImageButton ID="btnSaveEmployeePrevJobs" runat="server" ImageAlign="AbsBottom"
ImageUrl="~/Images/saveOff.gif" onmouseout="this.src='../Images/saveOff.gif'"
onmouseover="this.src='../Images/saveOn.gif'" OnClick="btnSaveEmployeePrevJobs_Click"/>
</ContentTemplate>
服务器端代码:
private void Timer_Tick(object sender, EventArgs args)
{
Timer1.Enabled = false;
//some code
}
protected void btnSaveEmployeePrevJobs_Click(object sender, EventArgs e)
{
// some code
}
问题:无法引发点击事件 单击按钮时,基本上 Timer 得到 启用(不知道为什么)并调用 再次自己而不是调用 click 事件..
提前谢谢..
【问题讨论】:
标签: .net asp.net c#-4.0 asp.net-ajax