I have an existing Web Site that uses multiple ASP .Net Web Forms projects. I have created an MVC 4 mobile web application to replace the login/ authorization web form project.
So far I have been able to replace all the functionality of the site, except I am unable to redirect to the ASP .Net pages from inside the Controller.
Using this method I can reach other MVC applications on the same web site without issue:
return Redirect("MyURLstring");
However when I redirect to a Web Forms page I receive several JS errors, and the Page never redirects. It looks like the MVC application is attempting to apply JQuery 1.7.1 to the URL that is being opened.
I can reach the URL without error if I include a rel=”external” tag within a hyperlink in a view.
I have also attempted to solve this by creating a route in my RouteConfig.cs file
RouteValueDictionary RouteValues = new RouteValueDictionary();
RouteValues["rel"] = "external";
return RedirectToRoute("MyRouteName", RouteValues);
Any help is greatly appreciated.
Solution:
I created the project as a MVC 4 Mobile site as a base, but still had the referencing to jQuery Mobile in my main _Layout view.
I kept this code intact for my _Layout.Mobile.cstml view, but changed to below for _Layout.cshtml
This allows me to perform a return Redirect(“myURL”); from the controller without hopping through all the jQuery that was preventing the redirect.