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/']
There is no such `HTML-Helper`, So your doing it the right way allready!(Ask for a salary raise...)

Just remove the `{}` as this code isn't a *"code block"*:

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

```

[C# Razor Syntax Quick Reference](http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx)
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)