Question: I would like my views to be able to specify a class for the `<body>` tag, which lies in my master page.

My first take was to do something like this: 

```
<asp:Content ContentPlaceHolderID="BodyClassContent" runat="server">
    view-item</asp:Content>

```

However, that would require this in the master page, which doesn't work:

```
<body class="<asp:ContentPlaceHolder ID="BodyClassContent" runat="server" />">

```

Any solutions to this?

Answer: 
In the layout you can do this on the body tag:

```
<body @RenderSection("BodyAttributes", false)>

```

and then in your view you can do this:

```
@section BodyAttributes {
    id="login" class="login"
}

```

Edit: I also had to do this working with VB.NET and WebForms today and found a handy link for achieving the [equivalent](http://www.codeproject.com/Articles/19386/Adding-attributes-to-the-lt-body-tag-when-using-Ma)
Why don't you do in your masterpage:

```
<body class="<%=ViewData["bodyClass"].toString()%>">

```

and then set ViewData["bodyClass"] in your Controller actions? That should be equivalent...