I want to show text on two separate lines for the page header:
@section featured {
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1>@ViewBag.Message</h1>
</hgroup>
</div>
</section>
}
I have the following code in controller:
public ActionResult Login(string returnUrl)
{
StringBuilder sb = new StringBuilder();
sb.Append("Web Security Administration Portal");
sb.AppendLine();
sb.AppendLine();
sb.Append("Services, Inc. - SSOAdmin v2.00");
ViewBag.ReturnUrl = returnUrl;
ViewBag.Message = sb.ToString();
return View();
}
ViewBag
does not show new line. When viewing source code of generated html, looks like that two strings are on separated lines, but when page is rendered, lines are not separated.
I tried to use sb.Append(Environment.NewLine)
and sb.Append(Text{0}, Environment.NewLIne)
as well. Does not help here.
What can be wrong here?