Hi All,
I have a problem with a admin plugin that i'm developing.
This is the scenario:
My plugin name is: Nop.Plugin.Misc.PrenotazioneServizi
My route provider for plugin is:
routes.MapRoute("Nop.Plugin.Misc.PrenotazioneServizi.Servizi",
"PrenotazioneServizi/Servizio/{action}/{id}",
new { controller = "Servizio", action = "List", id = UrlParameter.Optional },
new[] { "Nop.Plugin.Misc.PrenotazioneServizi.Controllers" }
).DataTokens.Add("area", "admin");
My menu item route is:
public virtual void BuildMenuItem(MenuItemBuilder menuItemBuilder)
{
menuItemBuilder.Text("Gestione Servizi").Items(y =>
{
y.Add()
.Text("Servizi")
.Url("/PrenotazioneServizi/Servizio/List");
y.Add()
.Text("Risorse")
.Url("/PrenotazioneServizi/Risorsa/List");
y.Add()
.Text("Prenotazioni")
.Url("/PrenotazioneServizi/Prenotazione/List");
});
}
Inside plugin there are two different controllers for the moment:
Controllers/RisorsaController.cs
Controllers/ServizioController.cs
When i click on link menu "Servizi" in my plugin menu all works fine end I can view the list of record "Servizi".
At this point starts my problems because all action inside this view are rendered with the following urls:
localhost/admin/Servizio/Create
localhost/admin/Servizio/Edit/3
while the correct urls are:
localhost/PrenotazioneServizi/Servizio/Create
localhost/PrenotazioneServizi/Servizio/Edit/3
If remove the dataTokens Area,Admin all works fine inside my views but the url menu of admin area are displayed without admin suffix.
I have already tried the 5 parts urls but i cannot resolve the problem.
How can I Fix?
Thanks all for help.