SPA angularjs with MVC - partial view lose layout on refresh ? RRS feed

  • Question

  • User-1846805900 posted


    i have create new SPA project and work on it with angularjs & mvc partial views it works fine, but i had one problem when i refresh page i got the partial view without any layout No css files & No script Files - first time i got page as:

    and everything is working fine, but when i refresh i got it as:

    angular route js;

    app.config(function ($routeProvider, $locationProvider) {
                                templateUrl: 'Customers/AllCustomer', 
                                controller: 'AllCustomersController' 
                                templateUrl: 'Customers/AddNewCustomer', 
                                controller: 'AddCustomerController' 

    final result is:


    now refresh is working as i need but url still have "#"

     try to use html5Mode to remove # as :

            enabled: true,
            requireBase: false,
            hashPrefix: '!'

    but when # still in <a> nothing happened and page content don't load &  i got url as:


    and if i remove # from <a> gor url as:


    but refresh not working 

    so please :

    ** did i must use # to let it work on refresh ?

    ** are there no other way to make partial view get layout on refresh and make url don't has "#" ?

    Monday, July 6, 2015 4:26 AM


  • User-1846805900 posted

    Thanks a lot - i fix it by using # in the URL

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 12, 2015 8:12 PM

All replies