0

I am trying out MVC in existing MVC application . I want to do redirect from webform which is in 'Folder1' to MVC Homecontroller which is in Controllers folder ,same level as Folder1.
I tried this ,its The controller for path '/' was not found or does not implement IController.

UrlHelper urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext);   
Response.Redirect(urlHelp.Action("About", "Home"), false);

and even tried with

Response.Redirect(HttpRuntime.AppDomainAppVirtualPath + "Home/Index");

even tried this

UrlHelper urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext);           
Response.Redirect(urlHelp.Action("Index", "Home",new { area = string.Empty }),false);

didn`t work out ..Anybody have idea?

surajs1n
  • 1,493
  • 6
  • 23
  • 34
waji
  • 1
  • 1

1 Answers1

0

Try this?

UrlHelper urlHelp = new UrlHelper(Request.RequestContext);
Response.Redirect(Request.Url.GetLeftPart(System.UriPartial.Authority) + urlHelp.Action("About", "Home"), false);
Mike Wallace
  • 543
  • 4
  • 15
  • I am getting this error. The controller for path '/' was not found or does not implement IController. – waji Mar 08 '16 at 18:49
  • I changed my answer. Please try it out. – Mike Wallace Mar 08 '16 at 19:06
  • hmm. i must be missing something here. If you set a string up and equal it to that path what is the URL you get at runtime? trade out response.redirect for string test =... If the string you get doesn't look like the URL you need play with that first part until it does. – Mike Wallace Mar 08 '16 at 21:29