问题描述
如果定义了<httpHandlers><addverb="POST,GET"path="ajaxpro/*.ashx"type="AjaxPro.AjaxHandlerFactory,AjaxPro"/></httpHandlers>无论怎么修改源码,输出显示都一样,没有反应,前台:<%@ControlLanguage="C#"AutoEventWireup="true"CodeBehind="nofity.ascx.cs"Inherits="AnyOffice.general.mytable.nofity"%><scripttype="text/javascript">functionopen_notify(notify_id){URL="/general/notify/show/read_notify.aspx?notify_id="+notify_id;myleft=(screen.availWidth-500)/2;window.open(URL,"read_notify","height=460,width=650,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");}</script><divid="module_1"style="position:relative;padding-bottom:10px;"><tableclass="TableBlock"width="100%"cellspacing="0"cellpadding="2"><trclass="TableHeader"><tdid="module_1_head"class="TableHeader"width="70%"><imgsrc="/images/menu/notify.gif"align="absMiddle">公告通知</td><tdid="module_1_more"align="right"><divstyle="float:right"><ahref="/general/notify/show/index.aspx"><fontcolor="#FFFFFF">显示全部</font></a> </div></td></tr><trclass="TableData2"><tdcolspan="2"height="225"><divid="divNotify"><asp:Repeaterid="rptNotify"runat="server"EnableViewState="False"><ItemTemplate><ahref="javascript:open_notify(<%#DataBinder.Eval(Container.DataItem,"NotifyId")%>);"><spanstyle="<%#(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,"Important").ToString())==true)?"font-weight:bold;color:#FF0000;":""%>">【<%#DataBinder.Eval(Container.DataItem,"TypeName")%>】<%#(DataBinder.Eval(Container.DataItem,"Subject").ToString().Length>20)?DataBinder.Eval(Container.DataItem,"Subject").ToString().Substring(0,20)+"...":DataBinder.Eval(Container.DataItem,"Subject").ToString()%></span></a>(<%#Convert.ToDateTime(DataBinder.Eval(Container.DataItem,"SendTime")).ToString("d")%>)<%#DataBinder.Eval(Container.DataItem,"Readers")!=DBNull.Value?GetNew(DataBinder.Eval(Container.DataItem,"Readers").ToString()):"<imgsrc=/images/new.gifalign=absmiddle>"%><br/></ItemTemplate></asp:Repeater><asp:Literalid="litNotify"runat="server"></asp:Literal></div></td></tr></table></div><SCRIPTlanguage="javascript">CODE_IDSTR+="1,";vartimer_notify=null;varstr_notify="";functionGetNotify(){if(timer_notify!=null)window.clearTimeout(timer_notify);AnyOffice.general.mytable.AjaxMethods.GetNotify(CallBack_GetNotify);timer_notify=setTimeout("GetNotify()",AJAX_INTERVAL*10);}functionCallBack_GetNotify(res){if(res.error!=null)return;if(str_notify!=res.value)document.getElementById('divNotify').innerHTML=res.value;str_notify=res.value;}GetNotify();</SCRIPT>后台:usingSystem;usingSystem.Reflection;usingSystem.Data;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Data.SqlClient;usingAnyOffice.Components;usingAnyOffice.DAL;usinglog4net;usingAjaxPro;namespaceAnyOffice.general.mytable{publicpartialclassnofity:System.Web.UI.UserControl{privatestaticILoglog=LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);protectedvoidPage_Load(objectsender,EventArgse){try{SqlConnectionconn=newSqlConnection(ConfigManager.ConnectionString);NotifyDaodao=newNotifyDao();UserCachecache=newUserCache();DataTabletable=dao.SelectMyTable(conn,cache.DeptId,cache.PrivId,cache.UserId);if(table.Rows.Count>0){this.rptNotify.DataSource=table;this.rptNotify.DataBind();}else{this.litNotify.Text="·无信息";}if(conn.State==ConnectionState.Open){conn.Close();}}catch(Exceptionexception){if(log.IsErrorEnabled){log.Error("",exception);}}}publicstringGetNew(stringreaders){readers=","+readers+",";if(readers.IndexOf(","+newUserCache().UserId+",")<0){return"<imgsrc=/images/new.gifalign=absmiddle>";}returnstring.Empty;}}}如果在web.config中注视掉<httpHandlers><addverb="POST,GET"path="ajaxpro/*.ashx"type="AjaxPro.AjaxHandlerFactory,AjaxPro"/></httpHandlers>修改源码,有反应,如果加上,无论怎么修改前台源码,输出结果都是一样的。
解决方案
解决方案二:
现在问题就出在AnyOffice.general.mytable.AjaxMethods.GetNotify(CallBack_GetNotify);timer_notify=setTimeout("GetNotify()",AJAX_INTERVAL*10);中的.AjaxMethods.,请高手赐教
解决方案三:
怎么可能让前台代码去掉用后台的函数?
解决方案四:
麻烦高手帮忙修改下
解决方案五:
清缓存了吗