Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

View without layout in asp.net MVC

If you want to show view without any surrounding _Layout page, you can set Layout=null.

Code sample,

With following custom error view, you displayed without surrounding _Layout page.

@{
    Layout = null;
}
<div class="alert alert-danger alert-dismissible fade show">
    <div>
        <h5>Error! </h5>
        <h6>Something went wrong, contact admin, or try again</h6>
    </div>
</div>

Invalid entry,please enter valid data.

Loading