passing id to controller

passing id to controller

I have 4-5 partial view files (.ascx) like
abc.ascx, cde.ascx, fgh.ascx.

I want to return different partial views based on the name of the view passed to url parameter like this
/someservice/abc will go to action someservice and will return abc.ascx partial view.
/someservice/cde will go to action someservice and will return cde.ascx partial view.

How can achieve this?

“this” in function parameter


Failing to connect to Database due to database in recovery
Try this... Partial view postback from a standard Html form with MVC(untested, if it doesn't job let me know and I'll have a play with it). Using a .NET MVC Controller Action as the Source for an HTML <img> In your Global.asax.cs, above the default route, map this route:. ASP.NET MVC: How do I validate a model wrapped in a ViewModel?
 routes.MapRoute(        "SomeService",        "Home/SomeService/{view}",      new { controller = "Home", action="SomeService", view = "" }     ); 
In your controller:. ASP.NET MVC Rich Text Editor not showing buttons
 public class HomeController : Controller  {      public ActionResult SomeService(string view)      {          return View(view);      }  } 
Call it with Home/SomeService/abc etc.... Is there a template language for ASP.NET MVC like JSTL and OGNL?
Selling upper management on converting to ASP.NET from Classic ASP

58 out of 100 based on 73 user ratings 268 reviews