我有一个仅适用于 Firefox 的登录页面。它不适用于任何其他浏览器。
当我检查事件日志时,我看到“响应在当前上下文中不可用”。它告诉我错误在 global.asax 文件中的 response.redirect 行:
void Session_End(object sender, EventArgs e)
{
Response.Redirect("~/Login.aspx?li=1");
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
Run Code Online (Sandbox Code Playgroud)
可能是什么问题呢?
我已经按照建议尝试了 httpcontext.Current 但后来我得到了一个空引用异常,对象引用未设置为对象的实例
谢谢你。
| 归档时间: |
|
| 查看次数: |
10071 次 |
| 最近记录: |