I have a lot of static IF statements that I need to use to build a page. How would I add this to the view itself (not the controller.)

**Example:** view: test.chtml

```
@{ if (!Request.Browser.IsMobileDevice)
   {
    <p>Write this to html</p>
    }
}

```

I am not sure which html helper I should use to make this write to the page.
['https://Stackoverflow.com/questions/9693323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/719825/']
if you go

```
    @:<p>Write this to html</p>

```

this may work

Although instead of putting it in a code block i perfer

```
    @if (!Request.Browser.IsMobileDevice)
    {
      <p>Write this to html</p>
    }

```
Razor has a native if statement: `@if` does what you want. You might be interested in the following two links:

[ASP.Net's basic guide to writing views with Razor](http://www.asp.net/web-pages/tutorials/basics/2-introduction-to-asp-net-web-programming-using-the-razor-syntax)

[Phil Haack's concise syntax guide for Razor](http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx)