Further Information added below
When using the following "RedirectToAction" (which produces the following URL) I get:
**The view 'searchterm' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/browse/searchterm.aspx
~/Views/browse/searchterm.ascx
~/Views/Shared/searchterm.aspx
~/Views/Shared/searchterm.ascx
~/Views/browse/searchterm.cshtml
~/Views/browse/searchterm.vbhtml
~/Views/Shared/searchterm.cshtml
~/Views/Shared/searchterm.vbhtml**
Action generating the request:
public ActionResult Action(string id)
{
if (!(string.IsNullOrEmpty(id)))
{
string SearchTerm = id;
return RedirectToAction("Products", new { SearchString = SearchTerm, Layout = "Row" });
}
return View();
}
URL:http://localhost:52006/browse/Products?SearchString=searchterm&Layout=Row
RouteConfig:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" });
routes.MapRoute(
"Admin", // Route name
"Admin/{controller}/{action}/{id}", // URL with parameters
new { controller = "Dashboard", action = "Index", id = "" });
}
Products Controller: public ActionResult Products(string SearchString, string Layout = "Grid") { ViewBag.Layout = Layout; return View(SearchString); }
further information
urls that end up going through the "products" action and being processed:
http://localhost:52006/Browse/Products?Layout=Row#
interesting because it shows that the parameters are not what is throwing the routing off
urls that end up looking for an action with name = SearchString:
http://localhost:52006/Browse/Products?Search=acolyte&Layout=Row
- interesting because it shows that the order of the parameters is not throwing the routing off/ it isn't just grabbing the first parameter as the action to look for.
http://localhost:52006/Browse/Products?Layout=Row&Search=acolyte