On analyzing your code, we found that, there is URL path doesn’t provide properly in the menu item. This is the cause of the issue while click on menu item it doesn’t navigate to the proper page. To resolve this issue, we need to remove the symbol ~/ in the provided path url. Please find the code for the same,
<code>
<ej:Menu ID="menuPrincipal" runat="server" CssClass="menuPrincipal">
<Items>
<ej:MenuItem Text="Inicio" Url="Default.aspx" ></ej:MenuItem>
<ej:MenuItem Text="Control Operaciones">
<Items>
<ej:MenuItem Text="Electricidad">
<Items>
<ej:MenuItem Text="Informe Diario" Url="ControlOperaciones/Electricidad/InformeDiario.aspx"/>
<ej:MenuItem Text="Informe Semanal" Url="ControlOperaciones/Electricidad/InformeSemanal.aspx" />
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gas">
<Items>
<ej:MenuItem Text="Informe Diario" Url="ControlOperaciones/Gas/InformeDiario.aspx" />
<ej:MenuItem Text="Informe Semanal" Url="ControlOperaciones/Gas/InformeSemanal.aspx" />
</Items>
</ej:MenuItem>
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gestión Campañas"></ej:MenuItem>
<ej:MenuItem Text="Informes Mensuales Data G&E"></ej:MenuItem>
<ej:MenuItem Text="Informes Resultados Control Calidad"></ej:MenuItem>
<ej:MenuItem Text="Indicadores LMyO" Url="IndicadoresLMyO/Default.aspx"></ej:MenuItem>
</Items>
</ej:Menu>
</code>
We have prepared the sample based on this and please refer to the following sample:
Sample: Sample
Please let us know if you have further query.
Regards,
Kasithangam
<appSettings>
<add key="LoadEJResourcesFromAssembly" value="true" />
<add key="EJResources" value="jsrender:true;jqueryeasing:true;globalize:true;themes:true;" />
</appSettings>
</code>
While enabling LoadEJResourcesFromAssembly and EJResoures app key settings it will include our necessary script and CSS files as embedded resource from the EJ.Web assembly itself.
Also, we need to modify the URL path in menu control based on the folder structure and please find the code for same:
<code>
<ej:Menu ID="menuPrincipal" runat="server" CssClass="menuPrincipal">
<Items>
<ej:MenuItem Text="Inicio" Url="../../Default.aspx" ></ej:MenuItem>
<ej:MenuItem Text="Control Operaciones">
<Items>
<ej:MenuItem Text="Electricidad">
<Items>
<ej:MenuItem Text="Informe Diario" Url="../../ControlOperaciones/Electricidad/InformeDiario.aspx"/>
<ej:MenuItem Text="Informe Semanal" Url="../../ControlOperaciones/Electricidad/InformeSemanal.aspx" />
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gas">
<Items>
<ej:MenuItem Text="Informe Diario" Url="../../ControlOperaciones/Gas/InformeDiario.aspx" />
<ej:MenuItem Text="Informe Semanal" Url="../../ControlOperaciones/Gas/InformeSemanal.aspx" />
</Items>
</ej:MenuItem>
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gestión Campañas"></ej:MenuItem>
<ej:MenuItem Text="Informes Mensuales Data G&E"></ej:MenuItem>
<ej:MenuItem Text="Informes Resultados Control Calidad"></ej:MenuItem>
<ej:MenuItem Text="Indicadores LMyO" Url="../../IndicadoresLMyO/Default.aspx"></ej:MenuItem>
</Items>
</ej:Menu>
</code>
Now, when you click on the menu item the corresponding page navigates properly.We have modified the sample based on this and please refer to the following sample:
Sample: Sample
Please let us know if you have further query.
Regards,
Kasithangam
Hi Manolo,
Thanks for your update. Please get back to us if you have further queries. We will be happy to help you out.
Regards,
Kasithangam
Hi Manolo,
We can set the tag runat=”server” for the menu items in order to access the corresponding item in server side. So we can set runat=”server” for the menu items as shown in the following code snippet.
<code>
<ej:Menu ID="menuPrincipal" runat="server" CssClass="menuPrincipal">
<Items>
<ej:MenuItem runat="server" Text="Inicio" Url="../../Default.aspx"></ej:MenuItem>
<ej:MenuItem runat="server" Text="Control Operaciones">
<Items>
<ej:MenuItem runat="server" Text="Electricidad">
<Items>
<ej:MenuItem runat="server" Text="Informe Diario" Url="../../ControlOperaciones/Electricidad/InformeDiario.aspx"/>
<ej:MenuItem runat="server" Text="Informe Semanal" Url="../../ControlOperaciones/Electricidad/InformeSemanal.aspx"/>
</Items>
</ej:MenuItem>
</Items>
</ej:Menu>
</code>
Please let us know if you have any other queries.
Regards,
Saranya.S
Hi Manolo,
We regret for the inconvenience caused,
You can still use runat server for the menu items even though it is not shown in intellisence. Also we suggest use to use Page.ResolveClientUrl to maintain the path accordingly. While hosting it in server it possess the corresponding path. Please refer the below code snippet for more details.
<code>
<ej:Menu ID="menuPrincipal" runat="server" CssClass="menuPrincipal">
<Items>
<ej:MenuItem Id="menuitem1" Text="Inicio" Url="<%= Page.ResolveClientUrl('~/Default.aspx')%>" ></ej:MenuItem>
<ej:MenuItem Text="Control Operaciones">
<Items>
<ej:MenuItem Text="Electricidad">
<Items>
<ej:MenuItem Text="Informe Diario" Url="<%= Page.ResolveClientUrl('~/ControlOperaciones/Electricidad/InformeDiario.aspx')%>"/>
<ej:MenuItem Text="Informe Semanal" Url="<%= Page.ResolveClientUrl('~/ControlOperaciones/Electricidad/InformeSemanal.aspx')%>" />
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gas">
<Items>
<ej:MenuItem Text="Informe Diario" Url="<%= Page.ResolveClientUrl('~/ControlOperaciones/Gas/InformeDiario.aspx')%>" />
<ej:MenuItem Text="Informe Semanal" Url="<%= Page.ResolveClientUrl('~/ControlOperaciones/Gas/InformeSemanal.aspx')%>" />
</Items>
</ej:MenuItem>
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gestión Campañas"></ej:MenuItem>
<ej:MenuItem Text="Informes Mensuales Data G&E"></ej:MenuItem>
<ej:MenuItem Text="Informes Resultados Control Calidad"></ej:MenuItem>
<ej:MenuItem Text="Indicadores LMyO" Url="<%= Page.ResolveClientUrl('~/IndicadoresLMyO/Default.aspx')%>"></ej:MenuItem>
</Items>
</ej:Menu>
</code>
For your convienience we have modified the sample based on hosting in server and the same can be downloaded from the following location.
http://www.syncfusion.com/downloads/support/forum/120497/ze/MenuUrl1247599311
Kindly check with the sample. If still you face the problem then please share us the online link which you have hosted in the server. Also if possible please share us the entire sample in which we can able to reproduce the error. This will be helpful for us to serve you better.
Regards,
Saranya.S
Hi Manolo,
We would like to let you know that, we have to specify the URL path according to your folder structure to which the Menu item should get navigated. In your update we have found that you are having a folder named “website” and you have been navigating to it. So you have to mention the URL as shown in the following code snippet.
<code>
<ej:Menu ID="menuPrincipal" runat="server" CssClass="menuPrincipal">
<Items>
<ej:MenuItem Id="menuitem1" Text="Inicio" Url="<%= Page.ResolveClientUrl('~/website/Default.aspx')%>" ></ej:MenuItem>
<ej:MenuItem Text="Control Operaciones"></ej:MenuItem>
<%-- Your Menu Items Here --%>
</Items>
</ej:Menu>
</code>
So Kindly set the path according to your folder structure. If still you face the problem then please share us your hosted sample along with the folder structure and share us your username and password. This will be helpful for us to serve you better.
Regards,
Saranya.S
<ej:Menu ID="menuPrincipal" runat="server" CssClass="menuPrincipal">
<Items>
<ej:MenuItem Text="Inicio" Url="~/Default.aspx" ></ej:MenuItem>
<ej:MenuItem Text="Control Operaciones">
<Items>
<ej:MenuItem Text="Electricidad">
<Items>
<ej:MenuItem Text="Informe Diario" Url="~/ControlOperaciones/Electricidad/InformeDiario.aspx"/>
<ej:MenuItem Text="Informe Semanal" Url="~/ControlOperaciones/Electricidad/InformeSemanal.aspx" />
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gas">
<Items>
<ej:MenuItem Text="Informe Diario" Url="~/ControlOperaciones/Gas/InformeDiario.aspx" />
<ej:MenuItem Text="Informe Semanal" Url="~/ControlOperaciones/Gas/InformeSemanal.aspx" />
</Items>
</ej:MenuItem>
</Items>
</ej:MenuItem>
<ej:MenuItem Text="Gestión Campañas"></ej:MenuItem>
<ej:MenuItem Text="Informes Mensuales Data G&E"></ej:MenuItem>
<ej:MenuItem Text="Informes Resultados Control Calidad"></ej:MenuItem>
<ej:MenuItem Text="Indicadores LMyO" Url="~/IndicadoresLMyO/Default.aspx"></ej:MenuItem>
</Items>
</ej:Menu>
[cs]
protected void Page_Load(object sender, EventArgs e)
{
for (int index = 0; index < menuPrincipal.Items.Count; index++)
{
if (!string.IsNullOrEmpty(menuPrincipal.Items[index].Url))
menuPrincipal.Items[index].Url = Page.ResolveClientUrl(menuPrincipal.Items[index].Url);
for (int index1 = 0; index1 < menuPrincipal.Items[index].Items.Count; index1++)
{
if (!string.IsNullOrEmpty(menuPrincipal.Items[index].Items[index1].Url))
menuPrincipal.Items[index].Items[index1].Url = Page.ResolveClientUrl(menuPrincipal.Items[index].Items[index1].Url);
for (int index2 = 0; index2 < menuPrincipal.Items[index].Items[index1].Items.Count; index2++)
{
if (!string.IsNullOrEmpty(menuPrincipal.Items[index].Items[index1].Items[index2].Url))
menuPrincipal.Items[index].Items[index1].Items[index2].Url = Page.ResolveClientUrl(menuPrincipal.Items[index].Items[index1].Items[index2].Url);
}
}
}
}
</code>
We have prepared the Menu –URL navigation sample and its available in a below link:
http://www.syncfusion.com/downloads/support/forum/120497/ze/Sample_Menu1524654363
Please let us know if you have any other queries.
Regards,
Muralishankar