> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/asp-net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/asp-net/chapter1/1.1.the-complete-asp.net-mvc-5-course/12aspnet-mvc-fundamentals/121action.md).

# 1.2.1.Action

## 1.Action Result

* reference from udemy.com \[the complete aspnet mvc 5 course

  &#x20; ![](https://github.com/jenhsuan/asp-net/tree/4be758d868ba14011a3e816f30e65a6ee7ad7252/assets/螢幕快照%202017-04-01%20下午10.35.09.png)

## 2.Parameters source

* 1.以下寫法都會導到MovieController.Edit(int id):
  * 1.In the url
    * movie/edit/1
  * 2.In the query string

    * movie/edit?id=1

    ```
      public ActionResult Edit(int id)
      {
          return Content("id = " + id);
      }
    ```
* 2.Pass option parameters
  * movie/index?pageindex=100
  * movie/index?sortBy=releaseDate

    ```
    public ActionResult Index(int? pageIndex, string sortBy)
      {
          if(!pageIndex.HasValue)
          {
              pageIndex = 1;
          }

          if(String.IsNullOrWhiteSpace(sortBy))
          {
              sortBy = "Name";
          }

          return Content(String.Format("pageIndex={0}&sortBy={1}", pageIndex, sortBy));
      }
    ```
