0

I have one mvc application and that is running fine on 2 url's with the same code deployed to different folder for both the url's to work with different authentication method.

URL's are like https://www.example.com/ - web form authentication https://www.example.com/New/ - windows authentication

Now the requirement is we have to deploy the code in one folder only and both the url's should work like earlier with different authentication.

so now I've created a folder named 'NEW' with an asp.net webform within the MVC application and trying to call home controller of root directory after windows authentication.

I'm able to call the windows Authentication but after entering credentials it is not redirecting to https://www.example.com/Home/Index.

I've tried creating a *.aspx page and redirecting from there like below but nothing works.

Response.Redirect("../Home/Index");
this.Response.RedirectToRoute("~/Home/Index"); 

Any help will be appreciated

Ajeet Kumar
  • 687
  • 6
  • 12
  • see if this [link](https://stackoverflow.com/questions/56149217/how-to-redirect-from-webforms-to-a-mvc-view) helps – Ajeet Kumar Aug 08 '21 at 23:04
  • why not implement the two types of login on the same page, for example: https://www.example.com/Login/ and which redirects to Index? – Miguel Aug 09 '21 at 10:40
  • @Miguel: How to implement 2 types login(form and windows) on same page?? – Ashutosh Aug 09 '21 at 11:20
  • I mean how will you determine by hitting the url that which login method should be visible for the user – Ashutosh Aug 09 '21 at 20:09
  • @Ashutosh Do you want both methods to be visible to the user? – Miguel Aug 10 '21 at 15:15
  • No, but here situation is some users can only be able to access through forms authentication and some can use windows, and there is no clear segregation for the users that who can login through which method and this seggregation will be long term solution. so now I've created a folder named 'NEW' with an asp.net webform within the MVC application and should use windows authentication(https://www.example.com/New/) and need to call home controller of root directory from this webform while https://www.example.com/ should be working with forms authentication and is working fine. – Ashutosh Aug 10 '21 at 23:41

0 Answers0