简体   繁体   中英

Redirect to secured pages using location tag in web.config

I am developing web application in ASP.net4.0,

My web application lib. having one more folder "secured" it having separate web.config with location tag having path of Login form which is outside of secured folder. 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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