-1

enter image description here

I am trying to redirect to a different view (ApartmentController) , so I have tried all the methods mentioned here :RedirectToAnOtherView But none worked with me , Any help would be thankfull My Controller is ApartmentController my View Is Index so My url would be like "Apartment/Index" I have tried :

return RedirectToAction("/Apartment/Index",new Apartment());
return View("Apartment");
return RedirectToActionPermanent("Apartment");

none worked with me

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Mark Dibeh
  • 469
  • 7
  • 21

1 Answers1

0

If I'm not wrong then you're attempting path in same controller then please try this, it should be work:

return RedirectToAction("Index");

return RedirectToAction("Apartment", "Index");

If you are redirect one controller to another controller action then try this:

return RedirectToAction("yourAnotherActionName","yourAnotherControllerName");