I use WebMatrix.WebData; In my MVC project, inside controller I wrote this line of code:
[Authorize(Roles ="Members")]
When login fails, it will redirect my application to Home/Login. But I want to redirect to Home/Register. How can I do this?
I use WebMatrix.WebData; In my MVC project, inside controller I wrote this line of code:
[Authorize(Roles ="Members")]
When login fails, it will redirect my application to Home/Login. But I want to redirect to Home/Register. How can I do this?
Copyright © 2021 Jogjafile Inc.
If you are working with
web formsyou should change yourweb.configfile like this.if you are not you can change
LoginPath = new PathString("/Home/Register"),underConfigureAuthmethod inStartup classinsideApp_Start/Startup.Auth.cs