错误提示如下:Server Error in '/cy0506' 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. Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
UserWeb_Html_HomeHTML_MasterPage.Enter_Click(Object sender, EventArgs e) +67
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832 为什么纳闷呢?
第一:在vs内置浏览器中浏览没错(代码也绝对没问题,找了一上午了)。
第二:发布后在IIS上面浏览,也是没错的(经过多方面测试,证明了这一点)。
第三:当我把发布到IIS上面的Web发布到服务器的时候,居然给我报一个上面错误(而在我自己的机子上面又是正正常的、IIS用的别人的机子:自己机器上面的IIS不能用了要重装系统)。
以上三点遇到过的大虾请给我说一下,急~~~~~
,QQ:804458949.
解决此问题我愿意加分。
--------------------------------------------------------------------------------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. Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
UserWeb_Html_HomeHTML_MasterPage.Enter_Click(Object sender, EventArgs e) +67
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832 为什么纳闷呢?
第一:在vs内置浏览器中浏览没错(代码也绝对没问题,找了一上午了)。
第二:发布后在IIS上面浏览,也是没错的(经过多方面测试,证明了这一点)。
第三:当我把发布到IIS上面的Web发布到服务器的时候,居然给我报一个上面错误(而在我自己的机子上面又是正正常的、IIS用的别人的机子:自己机器上面的IIS不能用了要重装系统)。
以上三点遇到过的大虾请给我说一下,急~~~~~
,QQ:804458949.
解决此问题我愿意加分。
Session["UserName"] = this.EnterName.Value;
//读取验证码session
string yanz = Session["checkcode"].ToString();
string CheckCode = this.EnterYanz.Value;
if (yanz == CheckCode && CheckCode != null)
{
Response.Redirect("../../../UserWeb/Html/Error/Tiaozhuan.aspx");
}
else
{
Response.Redirect("../../../UserWeb/Html/Error/Error.htm");
}
估计是这句出问题了,Session["checkcode"]为NULL了
看看是不是对应的67行
检测结果
If(Session[""] == null)
{
Response.Write("Session in NULL");
}
try...catch后面所有的段落,Exception不要丢出来。
如果我session丢失,那么为什么在我自己的机子上面访问服务器网页不会出现这种情况。而在别人机子上面出现了呢?如果我session丢失,在我自己的机子上面访问服务器网页和别人机子上应该也是一样的啊。关键是现在是我机子访问服务器网页正常,在别人机子上面访问服务器网页出现上述错误。如果session丢失,别人的机子上面会丢失,我机子上面就不会了吗?。我纳闷的就是这一点儿,在自己机子上面访问服务器能正常,在别人机子上就不行了的哇。