mardi 28 mars 2017

White space at top of page after converting .net project to use layouts

I recently changed my .net project to use master pages / layout pages. Now when my index page is rendered there is some space at the top of the page right before navbar.

I inspected that page in chrome, there is some empty quotes at the top of body, Removing those in the inspector solves the issue. but I am unable to understand where does that comes from? Here is my index.cshtml file.

@{
  Layout = "~/Views/Shared/_Layout.cshtml";
  ViewBag.Title = "my title";
}
<!--HERO IMAGE-->
<div>
    //code
</div>

@section additionalStyles{
   //adding external stylesheets
}

I am using render section in my index page to load some style sheets not useful in the rest of the pages. These are loaded up just before the ending tag of layout page like this:

@RenderSection("additionalStyles", required: false);

What possibly be causing that quotes?

Aucun commentaire:

Enregistrer un commentaire