首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

相关Global.asax?请大家帮忙

2011-12-10 
有关Global.asax?请大家帮忙!protectedvoidApplication_BeginRequest(Objectsender,EventArgse){asetcsSe

有关Global.asax?请大家帮忙!
protected   void   Application_BeginRequest(Object   sender,   EventArgs   e)
{
a=setcsService.GetCustomerStateByCustID( "10001 ");
if(a==1)
{
//Response.Redirect( "LockCustomer.aspx ");//如果为 "1 "表明客户是锁定的.
Context.Response.Redirect( "LockCustomer.aspx ");
return;
}
                                    }
想让它条件成立时转到LockCustomer.aspx,为什么转不过去呢?


[解决办法]
a=setcsService.GetCustomerStateByCustID( "10001 ");
if(a==1)
{
//Response.Redirect( "LockCustomer.aspx ");//如果为 "1 "表明客户是锁定的.
Context.Response.Redirect( "LockCustomer.aspx ");
return;
}
else
{
Context.Response.Redirect( "LockCustomer.aspx ");
}
[解决办法]
前面孟老大刚回过类似的帖子

你这件事在这里做就不合适..
[解决办法]
看错了
[解决办法]
a=setcsService.GetCustomerStateByCustID( "10001 ");
//a是整型?
if(a.ToString()== "1 ")
{

HttpContext.Current.RewritePath( "LockCustomer.aspx ");
return;
}

热点排行
Bad Request.