bm网上传至服务器后出现如下:
但刷新后又正常了。求高手给解决,谢谢
问题补充:我用到了NVelocity做模板,这个以前没有用过,不清楚是不是这个问题
Server Error in '/' Application. -------------------------------------------------------------------------------- Session state has created a session id, but cannot save it because the response was already flushed by the application. 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.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. 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: [HttpException (0x80004005): Session state has created a session id, but cannot save it because the response was already flushed by the application.] System.Web.SessionState.SessionIDManager.SaveSessionID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) +3624169 System.Web.SessionState.SessionStateModule.DelayedGetSessionId() +199 System.Web.SessionState.SessionStateModule.ReleaseStateGetSessionID() +25 System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +874 System.Web.SessionState.SessionStateModule.OnEndRequest(Object source, EventArgs eventArgs) +208 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
取消一个地方的:Response.Flush(); 问题没有再出现。。。。。。
在网站的global.asax中的Session_Start中添加:
void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started string sessionId = Session.SessionID; }
试试
加过这个,无效。。。。
在页面中是如何处理Session的?
只是文章列表,没有用到Session
@网络农民: 在web.config中加上
<sessionState mode="Off" />
取消一个地方的:Response.Flush(); 问题没有再出现。。。。。。
取消什么地方的...Response.Flush();