> 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/125view.md).

# 1.2.5.View

## 1.Rasor Syntax

* Rasor code block

  ```
                @{

                }
  ```
* comments

  ```
                 @*
                 *@
  ```
* class

  ```
      @{

        var className = Model._costmers.Count > 5 ? "popular" : null;
      }
      h2 class="@className">@Model._movie.Name</h2
  ```
* else, if

  ```
   @if (Model._costmers.Count == 0)
    {
        <p>No one has rent</p>
    }
  ```

## 2.Partial View

* render partial view

```
            @model Vidly.ViewModel.RandomMovieViewModel
            @Html.Partial("NavBar", Model.movie)
```
