简体   繁体   English

使用web.config中的location标记重定向到安全页面

[英]Redirect to secured pages using location tag in web.config

I am developing web application in ASP.net4.0, 我在ASP.net4.0中开发Web应用程序,

My web application lib. 我的Web应用程序库。 having one more folder "secured" it having separate web.config with location tag having path of Login form which is outside of secured folder. 还有一个文件夹“安全”它具有单独的web.config,其中location标签具有Login表单的路径,该表单位于安全文件夹之外。 while calling secured pages it gives me login page which is expected but while entering login information after click on login button it can't redirect to secured page. 在调用安全页面时,它为我提供了预期的登录页面,但在点击登录按钮后输入登录信息时,它无法重定向到安全页面。

So,Please give me solution on this problem as i am expecting to redirect to secured page. 所以,请给我解决这个问题,因为我希望重定向到安全页面。

Thanks in advanced. 提前致谢。

If you want to be sent to /secured after successfully logging in, try setting setting the defaultUrl attribute in your web.config: 如果要在成功登录后发送/保护,请尝试在web.config中设置defaultUrl属性:

<system.web>
  <authentication mode="Forms">
    <forms defaultUrl="~/secured" loginUrl="~/login.aspx" />
  </authentication>
</system.web>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM