Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing same views (with controllers) for several areas
Message
De
05/05/2015 19:05:49
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01619445
Message ID:
01619449
Vues:
18
I thought such problems were the reason to create WebControls. Perhaps including such today even when they are not totally fleshed out might be prudent, if you encounter the problem today to make your environment flexible enough for this idea.

Warning: mostly reading stuff on current trends in web dev, not actually developing projects here ;-)



>Hi everybody,
>
>I am wondering what is the best way of sharing the same views between several areas?
>
>I have InvoicesList and I want to be able to present it from both Customer Accounts area and Guests Area. Originally Invoices (and all related functionality) was designed in the Customer Accounts area.
>
>Now I want to share it between these 2 areas.
>
>I moved and renamed the view. I named it InvoicesList and placed into Views/Shared folder in the project.
>
>In my controller js file I now have
>
>
>$stateProvider
>            .state('edit.invoices', {
>                url: '/invoices:invoiceId?accountNameHash?isNew',
>                views: {
>                    'invoices': {
>                        templateUrl: '/Views/Shared/InvoicesList',
>                        controller: 'invoicesSearchController'
>                    },
>                    'detail': {
>                        templateUrl: '/CustomerAccounts/Invoices/editForm',
>                        controller: 'invoicesCrudController'
>                    }
>                }
>            })
>
>In the AccountsController.cs I have now:
>
>
> [Route("InvoicesList")]
>        public ActionResult InvoicesList()
>        {
>            return PartialView();
>        }
>
>but it's not going hit.
>
>It should be something relatively simple I am missing here, I hope.
>
>Do you see what change should I make in order to get that view from the Shared place?
>
>Thanks in advance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform