public static void LawyerAdmin()
{
HttpCookie IDCookie = System.Web.HttpContext.Current.Request.Cookies["MyCookie"];
if (IDCookie == null)
{
Tools.GoTop("您已退出或连接超时,请重新登录", "/");
return;
}
else
{
int iUserType = Convert.ToInt32(IDCookie.Values["UserType"]);
if (iUserType != 1)
{
Tools.GoTop("身份验证不符合要求!", "/User");
return;
}
}
} 这个return为什么无效呀!? 谁能帮忙解决一下呀
{
HttpCookie IDCookie = System.Web.HttpContext.Current.Request.Cookies["MyCookie"];
if (IDCookie == null)
{
Tools.GoTop("您已退出或连接超时,请重新登录", "/");
return;
}
else
{
int iUserType = Convert.ToInt32(IDCookie.Values["UserType"]);
if (iUserType != 1)
{
Tools.GoTop("身份验证不符合要求!", "/User");
return;
}
}
} 这个return为什么无效呀!? 谁能帮忙解决一下呀
解决方案 »
- 站内搜索SQL语句:select * from article where content like '%'+@keyword+'%'执行两分钟没结果,详情>>
- 请问开源质量又不错的免费“网店系统”有哪些?
- 像6.cn或126.com这样的网站的[搜索]按钮无法[另存为],请问具体是怎么做到的?
- asp1.1到asp2.0的一些问题?
- 各位老大 小弟只有1个小时时间要处理这个问题 请帮我看看
- UrlRewritingNet.UrlRewriter.dll 重写 url 能不能在虚拟主机上使用,需要设置吗?
- 50分,求一条sql语句
- 急急急
- !!window Event 高手请进:
- 这个问题有点难度:OledbCommandBuilder:生成的update语句.....
- 时间字段的问题
- 散分(1')个人站点相互做友情链接
还有return直接就是走到 函数的结尾处...
请问你都return是想要干什么
{
}
下面再写一句话看看能不能执行,不就知道return管不管用了?
Response.Redirect("index.aspx?ste=1")带个参数过去!
在登陆页接收到这个参数再去执行啊!
你说你 要能有效的执行Tools.GoTop("您已退出或连接超时,请重新登录", "/");
这里没错啊·。执行了之后retrun有没有都没关系。因为return已经在你if尾端。return作用说白了就是跳出他当前 的括号。
进去没有啊,你看看你两个if语句
Response.Write("<script>alert('您已退出或连接超时,请重新登录');window.document.URL='Default2.aspx';</script>");既然你都是为空就跳转了,他就不用带参了 ,直接response.redirect(“地址”);
Tools.GoTop()方法正确不?有可能和那人个"/"有关系Tools.GoTop("您已退出或连接超时,请重新登录", "//");
或
Tools.GoTop("您已退出或连接超时,请重新登录", @"/");
试试
这句还 可以加参数
加参
Response.Write(" <script>alert('您已退出或连接超时,请重新登录');window.document.URL='Default2.aspx?id=100'; </script>");
如果你的
Tools.GoTop("您已退出或连接超时,请重新登录", "/"); 都执行不到的话,就说明你前面就有问题了,根本到不了return,还怎么判断无效
第一 你要做什么 你都没说清楚,怎么帮你解决?
Tools.GoTop("您已退出或连接超时,请重新登录", "/"); 这个自己定义的类吧?''/ " 应该就是跳转的路径了也就是跟目录,页面都跳转了。就算执行了return 你也看不到,这个return 没有意义。
你return 要干啥啊?楼主
同意13楼的意见
如果无效估计你的
Tools.GoTop("您已退出或连接超时,请重新登录", "/");
有问题吧?