使用Timer后,它在Local上运行完美但在服务器上却出错 [英] After using Timer its run perfect on Local but on server it Gives error
本文介绍了使用Timer后,它在Local上运行完美但在服务器上却出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误是: -
得到此错误:
服务器错误在'/'应用程序中。
编译错误
描述:编译服务此请求所需的资源时发生错误。请查看以下特定错误详细信息并相应地修改源代码。
编译器错误消息:CS1061:'ASP.moreproperty_aspx'不包含'Timer1_Tick'的定义,并且没有可以找到接受第一个类型'ASP.moreproperty_aspx'的扩展方法'Timer1_Tick'(你错过了使用指令或汇编引用吗?)
源错误:
第1157行:< br / >
第1158行:
第1159行:< asp:Timer ID = Timer1 runat = server 时间间隔 = 5000 ontick = < span class =code-keyword> Timer1_Tick >
第1160行:
第1161行:< br / >
源文件:d:\Sites \miltonandward.com \ public_html \ MoreProperty.aspx行:1159
显示详细的编译器输出:
显示完整编译来源:
Plz Plz帮助我..............
解决方案
< pre lang =cs> protected void Page_Load(< span class =code-keyword> object sender,EventArgs e)
{
string sss = xxx;
Response.AppendHeader( 刷新, 200);
if (!IsPostBack)
{
// CODE
}
}
The error is:-
get this error:
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'ASP.moreproperty_aspx' does not contain a definition for 'Timer1_Tick' and no extension method 'Timer1_Tick' accepting a first argument of type 'ASP.moreproperty_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 1157: <br />
Line 1158:
Line 1159: <asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick">
Line 1160:
Line 1161: <br />
Source File: d:\Sites\miltonandward.com\public_html\MoreProperty.aspx Line: 1159
Show Detailed Compiler Output:
Show Complete Compilation Source:
Plz Plz Help me..............
解决方案
protected void Page_Load(object sender, EventArgs e) { string sss = "xxx"; Response.AppendHeader("Refresh", "200"); if (!IsPostBack) { //CODE } }
这篇关于使用Timer后,它在Local上运行完美但在服务器上却出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文