Controller:
Code: Select all
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}
public ActionResult PersonInfo(string name, string city)
{
// other code for assign ViewData
return View();
}
}
Code: Select all
routes.MapRoute(
"Default", // Route name
"",
new { controller = "Home", action = "Index" } // Parameter defaults
);
routes.MapRoute(
"PersonInfo", // Route name
"{name}", // URL with parameters
new { controller = "Home", action = "PersonInfo", name= "" , city = ""} // Parameter defaults
Ich habe den Link zu meiner Frage besucht. Aber ich möchte auch Parameter übergeben.
Jeder hilft mir. Wie kann ich in JQuery eine Aktion beim Klicken auf eine Schaltfläche aufrufen?
Mobile version