Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

I have used the Asp.net MVC 5 Razor and angularjs. Now my view have the layout .That layout contains top and side menu bar. So when the view load i got nested page top and side bar in the ng-view.How do i resolve this.

If i was tried with another one root view and removed the layout.that was worked fine.but when i hit F5 loaded the action alone.Master content is missed

_Layout.cshtml

    <header ng-include="'/Partials/TopNavbar'" class="topnavbar-wrapper"></header>
    <!-- sidebar-->
    <aside ng-include="'/Partials/Sidebar'" ng-controller="SidebarController" class="aside"></aside>
    <!-- offsidebar-->
    <aside ng-include="'/Partials/Offsidebar'" class="offsidebar"></aside>
    <!-- Main section-->
    <section>
        <!-- Page content-->
        <div ui-view="" autoscroll="false" ng-class="app.viewAnimation" class="content-wrapper">
            Tested
            <div ui-view="" data-autoscroll="false" class="wrapper">
                @Styles.Render("~/bundles/bootstrapStyles")
                @Styles.Render("~/bundles/appStyles")
                @RenderBody()
                @Scripts.Render("~/bundles/baseScripts")
                @Scripts.Render("~/bundles/appScripts")
            </div>
        </div>
    </section>
    <!-- Page footer-->
    <footer ng-include="'/Partials/Footer'"></footer>

View

@{
// This is requried for AngularJS because we have to send only the view markup (not within the layout)
Layout = "~/Views/Shared/_Layout.cshtml";}


<small>Subtitle</small>

<div class="row">
    <div class="col-lg-12">
testing A blank template
    </div>
</div>

This view has refered the layout. So while page load the Master content loaded perfectly.but when the ng-view load again the master content loaded like nested.

share|improve this question
    
Some code would be wonderfull –  LeZohan68 May 26 at 13:05
    
I'm confused, you are using ng-view or ui-view? tag is ng-view & code says ui-view –  Pankaj Parkar May 26 at 13:42
    
Sorry,i have used the ui-view –  Dinesh Kumar May 27 at 4:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.