从站点重定向(Beta 2.0)

编程入门 行业动态 更新时间:2024-10-23 17:27:39
本文介绍了从站点重定向(Beta 2.0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 在某些时间段内,我希望我的网站的所有请求都被重定向, 只有我可以看到这样做的地方是 global.asax文件中的Session_Start事件处理程序但是当我尝试以下操作时: Session.Abandon(); Response.Redirect( www.site ) 我收到一个错误: System.Web.HttpException:会话状态已经创建了一个会话ID,但是不能保存它因为保存它响应已被应用程序刷新。 在System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context,String id,Boolean& redirected System.Web.SessionState.SessionStateModule,System.Web.SessionState.SessionStateModule.CreateS essionId() ,System.Web.SessionState.SessionStateModule, .Delayed GetSessionId() 在System.Web.SessionState.Sess ionStateModule.OnRelea seState(对象源, EventArgs eventArgs) at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs) System.Web.HttpApplication.SyncEventExecutionStep。 System.Web.HttpApplication.ExecuteStep上的SystemWeb.HttpApplication.IExecutionStep.Execute() (IExecutionS tep step,Boolean& completedSynchronously) 显然我没有以正确的方式接近 - 任何想法? 谢谢 Kev < " Mantorok">

解决方案

尝试使用Response.Clear() <无** @ tiscali.co.uk> schrieb im Newsbeitrag 新闻:dg ********** @ newsfeed.th.ifl ...

嗨 我唯一可以看到这样做的地方是在global.asax文件中的Session_Start事件处理程序中,但是当我尝试以下内容: Session.Abandon(); Response.Redirect( www.site ) 我收到错误: System.Web.HttpException:会话状态已创建会话ID,但无法保存,因为响应已被应用程序刷新。 在System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context,String id System.Web.SessionState.SessionStateModule.Delayed GetSessionId(System.Web.SessionState.SessionStateModule.CreateS essionId()上的,布尔和重定向,布尔& cookieAdded) ) <在System.Web.SessionState.SessionStateModule.OnRelea seState(Object source,EventArgs eventArgs) 在System.Web.SessionState.SessionStateModule.OnEndRe任务(对象源, EventArgs eventArgs) 在System.Web.HttpApplication.SyncEventExecutionStep上。 System.Web.HttpApplication.ExecuteStep上的SystemWeb.HttpApplication.IExecutionStep.Execute() (IExecutionS tep步骤,布尔& 完成异步) 显然我是''我没有以正确的方式接近这个 - 任何想法? Kev

试过,现在我得到了这个: System.Web.HttpException:会话状态已创建会话ID,但不能 保存因为应用程序已经刷新了响应。 Kev " Alexander Widera" < AW ** @ hrz.tu-chemnitz.de.invalid.de>在消息中写道 新闻:O%**************** @ tk2msftngp13.phx.gbl ...

尝试回复。 Mantorok之前的清除() <无** @ tiscali.co.uk> schrieb im Newsbeitrag 新闻:dg ********** @ newsfeed.th.ifl ...

嗨 句点我希望所有对我网站的请求都被重定向,我唯一可以看到这样做的地方是在global.asax文件中的Session_Start事件处理程序中,但是当我尝试以下内容时: Session.Abandon(); Response.Redirect( http:// www.site ) 我收到一个错误: System.Web.HttpException:会话状态创建了一个会话ID,但是无法保存,因为响应已被应用程序刷新。 在System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context,String id,Boolean& redirected System.Web.SessionState.SessionStateModule.Delayed GetSessionId() 在System.Web.SessionState.SessionStateModule.OnRelea seState(Object source,EventArgs eventArgs) 在System.Web.SessionState.SessionStateModule.OnEndRe任务(对象源, EventArgs) eventArgs) 在System.Web.HttpApplication.SyncEventExecutionStep上。 System.Web.HttpApplication.ExecuteStep上的SystemWeb.HttpApplication.IExecutionStep.Execute() (IExecutionS tep步骤,布尔& 完成异步) 显然我是''我没有以正确的方式接近这个 - 任何想法? Kev

如果你尝试: Response.Buffer = true; 一开始? " Mantorok" <无** @ tiscali.co.uk> schrieb im Newsbeitrag 新闻:dg ********** @ newsfeed.th.ifl ...

试过,现在我''得到这个: System.Web.HttpException:会话状态已创建会话ID,但无法保存,因为响应已被应用程序刷新。 /> Kev Alexander Widera < AW ** @ hrz.tu-chemnitz.de.invalid.de>在消息中写道新闻:O%**************** @ tk2msftngp13.phx.gbl ...

尝试Response.Clear()之前 Mantorok <无** @ tiscali.co.uk> schrieb im Newsbeitrag 新闻:dg ********** @ newsfeed.th.ifl ...

嗨 句点我想要重定向所有对我网站的请求,我唯一可以看到这样做的地方是global.asax文件中的Session_Start事件处理程序,但是当我尝试以下操作时: Session.Abandon(); Response.Redirect( http:// www.site ) 我收到一个错误: System.Web.HttpException:会话状态创建了一个会话ID,但是无法保存,因为响应已被应用程序刷新。 在System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context,String id,Boolean& redirected System.Web.SessionState.SessionStateModule.Delayed GetSessionId() 在System.Web.SessionState.SessionStateModule.OnRelea seState(Object source,EventArgs eventArgs) 在System.Web.SessionState.SessionStateModule.OnEndRe任务(对象源,EventArgs) eventArgs) 在System.Web.HttpApplication.SyncEventExecutionStep上。 System.Web.HttpApplication.ExecuteStep上的SystemWeb.HttpApplication.IExecutionStep.Execute() (IExecutionS tep步骤,布尔& 完成异步) 显然我是''我没有以正确的方式接近这个 - 任何想法? Kev

Hi During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(www.site) I get an error: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) at System.Web.SessionState.SessionStateModule.CreateS essionId() at System.Web.SessionState.SessionStateModule.Delayed GetSessionId() at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs) at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I''m not approaching this the right way - any ideas? Thanks Kev

解决方案

Try Response.Clear() before "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl...

Hi During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(www.site) I get an error: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) at System.Web.SessionState.SessionStateModule.CreateS essionId() at System.Web.SessionState.SessionStateModule.Delayed GetSessionId() at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs) at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I''m not approaching this the right way - any ideas? Thanks Kev

Tried that, now I''m getting this: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. Kev "Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:O%****************@tk2msftngp13.phx.gbl...

Try Response.Clear() before "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl...

Hi During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(www.site) I get an error: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) at System.Web.SessionState.SessionStateModule.CreateS essionId() at System.Web.SessionState.SessionStateModule.Delayed GetSessionId() at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs) at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I''m not approaching this the right way - any ideas? Thanks Kev

And if you try: Response.Buffer = true; at the beginning? "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl...

Tried that, now I''m getting this: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. Kev "Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:O%****************@tk2msftngp13.phx.gbl...

Try Response.Clear() before "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl...

Hi During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(www.site) I get an error: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) at System.Web.SessionState.SessionStateModule.CreateS essionId() at System.Web.SessionState.SessionStateModule.Delayed GetSessionId() at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs) at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I''m not approaching this the right way - any ideas? Thanks Kev

更多推荐

从站点重定向(Beta 2.0)

本文发布于:2023-11-01 17:52:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550005.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   站点   Beta

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!