产品使用及交流论坛

首页 » 产品使用交流区 » 安装及使用交流 » 求救XIYOU大神,网站提示132.aspx文件出错(貌似是日期的问题)
傲视飞天 - 2015/1/13 17:23:18
XIYOU,昨天网站还好好的,我就修改了一下后台字段管理里的发布日期里可修改取消了一下对勾,然后更新了一下表单文件,提交以后还能正确登陆网站,今天一早也能正常登陆,开完会后再登陆就提示以下错误了,提示错误如下:
貌似是module目录下的132.aspx文件的第18行出问题了,从备份的网站文件里覆盖132.aspx文件依然提示出错,请问XIYOU如何解决?

Server Error in '/' Application.
--------------------------------------------------------------------------------
Source File: d:\pageadmin\gov6_red\e\zdymodel\article\module\132.ascx    Line: 18
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:


Line 16: dr=dt.Rows;
Line 17: %><li><span class="title">
Line 18: <a href="<%=Detail_Url(dr)%>" target="<%=Target%>" title="<%=Server.HtmlEncode(dr["title"].ToString())%>" style="<%=dr["pa_style"]%>"><%=SubStr(dr["title"].ToString(),Title_Num,true)%></a></span><span class="date"><%=((DateTime)dr["thedate"]).ToString("MM-dd")%></span>
Line 19: </li><%
Line 20: }


Source File: d:\pageadmin\gov6_red\e\zdymodel\article\module\132.ascx    Line: 18


xiyou - 2015/1/13 17:56:45
模型里面这段
<%=((DateTime)dr["thedate"]).ToString("MM-dd")%>
改为:
<%=dr["thedate"].ToString()%>
提示这个错误大概意思是信息的日期值不符合规范无法转换格式导致的,可能是新发布的信息的日期字段值是空值。
1
查看完整版本: 求救XIYOU大神,网站提示132.aspx文件出错(貌似是日期的问题)