处理自定义错误401.2 [英] Handling Custom Errors 401.2
本文介绍了处理自定义错误401.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果获取错误401.2到另一个页面,我怎样才能重定向用户?
我想我应该可以在Global.asax中做到这一点?
或有什么更好的解决方法..
ASP.NET 2.0中有哪些更好的解决方案?
Patrick
How can i get to redirect users if the get error 401.2 to another page?
I guess i should be possible to do it in Global.asax?
Or are there any better ways around it..
Any better solutions in ASP.NET 2.0?
Patrick
推荐答案
我正在尝试使用此代码: -
Private Sub Global_EndRequest(ByVal发送者为对象,ByVal e As
系统.EventArgs)处理MyBase.EndRequest
如果Response.StatusCode = 401 AndAlso Request.IsAuthenticated = True则
Response.ClearContent()
服务器.Execute(" http://server/tests.aspx")
结束如果
结束子
我是谁转换为C#,但似乎没有开火:(不知道是什么'b
缺少
谢谢
private void Global_EndRequest(对象发送者,System.EventArgs e)
{
if(Response.StatusCode == 401&& Request.IsAuthenticated == true)
{
Response.ClearContent();
Server.Execute(" http://server/tests.aspx");
}
}
" Patrick.O.Ige" < NA ******** @ hotmail.com>在消息中写道
新闻:O8 ************** @ TK2MSFTNGP15.phx.gbl ...
I''m trying to use this code:-
Private Sub Global_EndRequest(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.EndRequest
If Response.StatusCode = 401 AndAlso Request.IsAuthenticated = True Then
Response.ClearContent()
Server.Execute("http://server/tests.aspx")
End If
End Sub
WHICH I CONVERTED TO C# but it seems not to fire:( don''t know what ''m
missing
Thanks
private void Global_EndRequest(object sender, System.EventArgs e)
{
if (Response.StatusCode == 401 && Request.IsAuthenticated == true)
{
Response.ClearContent();
Server.Execute("http://server/tests.aspx");
}
}
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP15.phx.gbl...
我怎样才能到达如果获取错误401.2到另一个页面,用户会重定向用户吗?
我想我应该可以在Global.asax中做到这一点吗?
或者有没有更好的方法来解决它...
任何更好的解决方案在ASP.NET 2.0中?
Patrick
How can i get to redirect users if the get error 401.2 to another page?
I guess i should be possible to do it in Global.asax?
Or are there any better ways around it..
Any better solutions in ASP.NET 2.0?
Patrick
我正在尝试使用此代码: -
Private Sub Global_EndRequest(ByVal sender As Object,ByVal e As
System.EventArgs)处理MyBase.EndRequest
如果Response.StatusCode = 401 AndAlso Request.IsAuthenticated = True然后
Response.ClearContent()
Server.Execute(" http://server/tests.aspx")
结束如果
结束子
我转向C#但似乎没有开火:(不知道是什么? />
缺少
谢谢
private void Global_EndRequest(对象发送者,System.EventArgs e)
{
if(Response.StatusCode == 401&& Request.IsAuthenticated == true)
{
Response.ClearContent();
Server.Execute(" http://server/tests.aspx");
}
}
" Patrick.O.Ige" < NA ******** @ hotmail.com>在消息中写道
新闻:O8 ************** @ TK2MSFTNGP15.phx.gbl ...
I''m trying to use this code:-
Private Sub Global_EndRequest(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.EndRequest
If Response.StatusCode = 401 AndAlso Request.IsAuthenticated = True Then
Response.ClearContent()
Server.Execute("http://server/tests.aspx")
End If
End Sub
WHICH I CONVERTED TO C# but it seems not to fire:( don''t know what ''m
missing
Thanks
private void Global_EndRequest(object sender, System.EventArgs e)
{
if (Response.StatusCode == 401 && Request.IsAuthenticated == true)
{
Response.ClearContent();
Server.Execute("http://server/tests.aspx");
}
}
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP15.phx.gbl...
我怎样才能到达如果获取错误401.2到另一个页面,用户会重定向用户吗?
我想我应该可以在Global.asax中做到这一点吗?
或者有没有更好的方法来解决它...
任何更好的解决方案在ASP.NET 2.0中?
Patrick
How can i get to redirect users if the get error 401.2 to another page?
I guess i should be possible to do it in Global.asax?
Or are there any better ways around it..
Any better solutions in ASP.NET 2.0?
Patrick
修正了它!
忘了它是C#
我需要添加处理程序
" Patrick.O.Ige" < NA ******** @ hotmail.com>在消息中写道
新闻:Ob ************* @ TK2MSFTNGP15.phx.gbl ...
Fixed it!
forgot it was C#
I for got to add the Handler
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:Ob*************@TK2MSFTNGP15.phx.gbl...
我正在尝试使用此代码: - 私有Sub Global_EndRequest(ByVal发送者作为对象,ByVal e As
System.EventArgs)处理MyBase.EndRequest
如果Response.StatusCode = 401 AndAlso Request。 IsAuthenticated = True然后
Response.ClearContent()
Server.Execute(" http://server/tests.aspx")
结束如果
结束Sub
我转向C#但似乎没有解雇:(不知道缺少什么
谢谢
private void Global_EndRequest(对象发送者,System.EventArgs) e)
如果(Response.StatusCode == 401&& Request.IsAuthenticated == true)
{
Response.ClearContent();
Server.Execute(" http://server/tests.aspx");
}
}
Patrick.O.Ige< na ******** @ hotmail.com>在留言中写道
新闻:O8 * ************* @ TK2MSFTNGP15.phx.gbl ...
I''m trying to use this code:-
Private Sub Global_EndRequest(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.EndRequest
If Response.StatusCode = 401 AndAlso Request.IsAuthenticated = True Then
Response.ClearContent()
Server.Execute("http://server/tests.aspx")
End If
End Sub
WHICH I CONVERTED TO C# but it seems not to fire:( don''t know what ''m
missing
Thanks
private void Global_EndRequest(object sender, System.EventArgs e)
{
if (Response.StatusCode == 401 && Request.IsAuthenticated == true)
{
Response.ClearContent();
Server.Execute("http://server/tests.aspx");
}
}
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP15.phx.gbl...
如果获取错误401.2到另一页,我怎样才能重定向用户?
我想我应该可以在Global.asax中做到这一点吗?
或者有更好的解决方法......
ASP.NET 2.0中有哪些更好的解决方案?
Patrick
How can i get to redirect users if the get error 401.2 to another page?
I guess i should be possible to do it in Global.asax?
Or are there any better ways around it..
Any better solutions in ASP.NET 2.0?
Patrick
这篇关于处理自定义错误401.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文