<asp:Timer ID="Timer1" OnTick="Timer1_Tick" Interval="5000" runat="server"></asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<input id="Hidden1" type="hidden" name="Data1" value="abc" />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
我正在使用ajax工具包进行parital postback。
protected void Timer1_Tick(object sender, EventArgs e)
{
Label2.Text = "Clicked " + DateTime.Now.ToString();
if (Application["Data"] != null)
{
string[] s;
//We know the type inside Application state so we cast it
s = (string[])Application["Data"];
StringBuilder builder = new StringBuilder();
foreach (string value in s)
{
builder.Append(value);
builder.Append('-');
}
Label1.Text = builder.ToString();
}
}
当我使用Internet Explorer时没有问题,5秒后它会回发。但是当我使用firefox时没有任何变化。我用firefox的开发工具查看里面,我看到有问题。
SyntaxError: missing ) after argument list ScriptResource.axd:5784:50
Error: ASP.NET Ajax client-side framework failed to load. Graph.aspx:42:39
ReferenceError: Type is not defined ScriptResource.axd:10:0
ReferenceError: Type is not defined ScriptResource.axd:10:0
ReferenceError: Sys is not defined Graph.aspx:55:0
ReferenceError: Sys is not defined Graph.aspx:79:0
我尝试了从web.config添加ScriptResource.axd的解决方案但是这个错误仍然存在且标签没有改变。为什么你认为这会发生?有什么问题?
答案 0 :(得分:0)
当我查看这些错误时,我看到一些广告软件是问题。我使用了广告软件清理器,这些错误消失了。