In the output, you can simply add a jQuery client script that will run after your page is inserted together:
$('body').addClass('yourClass');
Another method is to store class data in your controller, for example:
ViewData["MasterPageBodyClass"] = "yourClass";
Then in your view MasterPageyou can check for this and add it if it exists:
<%
string bodyClass = "";
if (ViewData["MasterPageBodyClass"] != null)
{
bodyClass = "class=\"" + ViewData["MasterPageBodyClass"].ToString() + "\"";
}
%>
<body <%= bodyClass %>>
, , , , ViewData, .