本文介绍了如何使用Navigate url进行菜单工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在网站主页上使用菜单进行导航。



菜单项目的右箭头选项中添加了菜单。



问题是我必须使用菜单点击事件,这可能不会触发由于使用了导航网址事件。



现在在项目的这个阶段,我无法重新创建动态菜单,我还创建了权限管理系统,根据目前的菜单系统。



他们有什么工作吗?



请建议。有点紧急。谢谢..



Atul



开始部分代码以供参考。整个菜单很长,可能没有用处。



Hi All,

I am using a menu on my master page in website for navigation.

The menu have been added within the right arrow option on menu item.

The problem is that I have to use the menu click event, which is not firing probably due to the use of navigate url event.

Now at this stage of project I cannot rework on creating dynamic menus and I have also created the rights management system according to the current menu system.

Is their any work around?

Pls suggest. A bit urgent. Thanks..

Atul

Starting part of code for reference. The whole menu is quite long and may not be useful to be posted.

<asp:Menu ID="Menu1" runat="server" BackColor="Silver" Font-Names="Andalus" Font-Size="Large" ForeColor="Black" style="font-size: medium" Orientation="Horizontal" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Width="100%" Font-Bold="True" CssClass="newStyle1" Font-Underline="False" OnMenuItemClick="Menu1_MenuItemClick"  >
    <Items>
        <asp:MenuItem Text="Masters" Value="Masters" >
            <asp:MenuItem Text="Plant" Value="Mill" NavigateUrl="~/APP_Pages/Material/Masters/MillMaster.aspx">
            </asp:MenuItem>

推荐答案

protected void mnuNavMenu_MenuItemClick(object sender, MenuEventArgs e)
  {
    switch (e.Item.Text)
    {
    case "Home":
      Response.Redirect("~/");
      break;
    case "Masters":
      Response.Redirect("~/APP_Pages/Material/Masters/MillMaster.aspx");
      break;
    ...
    ...
    ...
    default:
      Response.Redirect("~/");
      break;
    }
  }





如果你被迫转换为VB,请告诉我在哪里和我会看看。



添加VB转换[/ edit]



If you're stuck converting to VB, let me know where and I'll have a look.

[edit] Adding VB Conversion [/edit]

Protected Sub mnuNavMenu_MenuItemClick(sender As Object, e As MenuEventArgs)
	Select Case e.Item.Text
		Case "Home"
			Response.Redirect("~/")
			Exit Select
		Case "Masters"
			Response.Redirect("~/APP_Pages/Material/Masters/MillMaster.aspx")
			Exit Select
		Case Else
			Response.Redirect("~/")
			Exit Select
	End Select
End Sub





...希望有所帮助。



... Hope it helps.


这篇关于如何使用Navigate url进行菜单工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 10:24