Dynamic Actions of Controllers | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

  1. How to retrieve query string parameter in action.- By passing action argument as Query string parameter


 public ActionResult Index(string urlparameter)
            return Content("Your Url parameter is " + urlparameter);


  1. By ID Parameter:  ASP.NET MVC’s default routing convention is to treat the segment of a URL after the action method name as a parameter named ID. If your action method has a parameter named ID, then ASP.NET MVC automatically passes the URL segment to you as a parameter.
 public ActionResult Product(string id1)
            return Content("Your id is " + id1);