Code Snippet
// MVC3 looks in routedata, querystring
// C#4 default parameter of *
public ActionResult Search(string name = "*")
{
//var name = RouteData.Values["name"];
name = Server.HtmlEncode(name); // Content doesn't htmlencode
return Content(name);
//return Content("You have reached the cusine controller");
}
Code Snippet
// MVC3 looks in routedata, querystring, posted form values
// C#4 default parameter of *
public ActionResult Search(string name = "*")
{
if (name == "*") {
//return RedirectToAction("Search", "Cuisine", new { name = "french" });
return RedirectToRoute("Cuisine", new { name = "german" });
}
//var name = RouteData.Values["name"];
name = Server.HtmlEncode(name); // Content doesn't htmlencode
//return RedirectPermanent("http://www.programgood.net");
//return RedirectToAction("Index", "Home");
return Content(name);
//return Content("You have reached the cusine controller");
}