Hi
In below line where RedirectToLoginPage(); is to defined. Do we need to give in Web.Config
FormsAuthentication.RedirectToLoginPage();
Thanks
Hi
In below line where RedirectToLoginPage(); is to defined. Do we need to give in Web.Config
FormsAuthentication.RedirectToLoginPage();
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gowtham CpPosted Aug 21, 2024, 2:44 AM
You don't need to define
RedirectToLoginPage()inweb.config. That method is used in your C# code to redirect users to the login page when they’re not authenticated. Yourweb.configjust sets the login page and other settings, like this:In your code, you’d use
FormsAuthentication.RedirectToLoginPage();to handle the redirection.