简体   繁体   中英

how to set Form authentication in asp.net

I am aware of how to configure windows authentication using asp.net My requirement is as soon as the web page loads it should redirect to login page and in login page i need to enter windows credentials then it should validate using windows authentication method and redirect me to original page. Can anyone help me how to do it?

in web.config add the following lines of code

    <system.web>
    <authentication mode="Forms">
    <forms defaultUrl="indexpagename.aspx" loginUrl="Login.aspx" slidingExpiration="true" timeout="2880"></forms>
    </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