网站不稳定,怎么回事?
我们公司的网站,现在新增了一个在线订购的功能,不知道为什么,在商品一览表翻页的时候,常常在翻到第五页出现如下错误!
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 33: </HeaderTemplate>
Line 34: <ItemTemplate>
Line 35: <div id="TableBody"><div style="width:60px;margin-left:10px"><%#Eval("GoodsID")%></div><div style="width:100px;margin-left:20px"><%#Eval("GoodsName")%></div><div style="width:60px;margin-left:18px"><%#CategoryID_NameSwitch(Convert.ToInt32(Eval("GoodsCategory")))%></div><div style="width:60px;margin-left:20px"><%#Eval("GoodsVipPrice")%></div><div style="width:60px;margin-left:20px"><%#Eval("GoodsOriginalPrice")%></div><div style="width:60px;margin-left:20px"><%#Convert.ToDateTime(Eval("GoodsUpTime")).ToString("yyy-MM-dd")%></div><div style="width:135px;margin-left:20px"><a href='#' onclick='goodsOrder(<%#Eval("GoodsSN") %>,<%#Eval("GoodsID")%>)'>订购</a> <a href='goodDetails.aspx?GID=<%#Eval("GoodsSN")%>'>查看详细信息>></a></div></div>
Line 36: </ItemTemplate>
Line 37: </asp:DataList>
这个错误,看像来是因为实例对象为空,没有成功从数据库读取数据.
可是网站若在本地服务或是VS里运行的话,一切都正常,就是传到服务器里就会出现这种问题(无论测试还是正式运行,数据库都是连接外网虚拟主机里的数据库).
真的搞不懂为什么!
/////////////////////////////////////////////////////////////////////////////////////////////////
另外,还有当用户登录后,选购商品后,不作操纵,等个十分钟左右,再来操纵时就会出现如下错误!
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
这个错误,看起来好象是session超时吧!
可是session默认是20分钟吧,但一般停止操纵几分钟,常常不超过十分钟,就会出现这种错误!
真的头晕了好长时间,不知道问题到底在哪里!
那些大虾能给点建议....
谢谢....