0

メニュー項目の一部を非表示にする必要がありますが、方法がわかりません。

web.siteMap xmlファイルからデータを取得します。これはサイトマップであるため、すべてのページをWebサイトに含めました。問題は、これらのページの一部が正しく機能するためにクエリ文字列を必要とすることです。そして、彼がメニューからアイテムをクリックしたので、彼が間違ったページにいることをユーザーに伝える必要はありません。そこで、これらのページを非表示にすることにしました。

編集:私は削除したい:

<siteMapNode url="~/Categories/review_tab.aspx" title="TABLET REVIEWS" description="TABLET REVIEWS"/>
<siteMapNode url="~/Categories/review_lap.aspx" title="LAPTOP REVIEWS" description="LAPTOP REVIEWS"/>
<siteMapNode url="~/Categories/review_tab.aspx" title="TABLET REVIEWS" description="TABLET REVIEWS"/>
<siteMapNode url="~/Categories/review_cam.aspx" title="CAMERA REVIEWS" description="CAMERA REVIEWS"/>

サイトマップの構造は次のとおりです。

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/" title="Menu"  description="Menu">
        <siteMapNode url="~/Default.aspx" title="HOME"  description="HOME"></siteMapNode>
        <siteMapNode url="~/ContactUs.aspx" title="CONTACT US" description="CONTACT US" />
        <siteMapNode url="~/About.aspx" title="ABOUT US" description="ABOUT US" />
        <siteMapNode url="~/Members/Default.aspx" title="MEMBERS" description="MEMBERS">
            <siteMapNode url="~/Members/ChangePassword.aspx" title="CHANGE PASSWORD" description="CHANGE PASSWORD" />
        </siteMapNode>
        <siteMapNode url="~/login.aspx" title="REVIEWS"  description="REVIEWS">
            <siteMapNode url="~/Categories/Laptops.aspx" title="LAPTOP" description="LAPTOP"/>
            <siteMapNode url="~/Categories/review_lap.aspx" title="LAPTOP REVIEWS" description="LAPTOP REVIEWS"/>
            <siteMapNode url="~/Categories/Smartphones.aspx" title="SMARTPHONE" description="SMARTPHONE"/>
            <siteMapNode url="~/Categories/review_smart.aspx" title="SMARTPHONE REVIEWS" description="SMARTPHONE REVIEWS"/>
            <siteMapNode url="~/Categories/Tablets.aspx" title="TABLETS" description="TABLETS"/>
            <siteMapNode url="~/Categories/review_tab.aspx" title="TABLET REVIEWS" description="TABLET REVIEWS"/>
            <siteMapNode url="~/Categories/Cameras.aspx" title="CAMERAS" description="CAMERAS"/>
            <siteMapNode url="~/Categories/review_cam.aspx" title="CAMERA REVIEWS" description="CAMERA REVIEWS"/>
        </siteMapNode>
        <siteMapNode url="~/Account/Default.aspx" title="ACCOUNT" description="ACCOUNT">
          <siteMapNode url="~/Account/Register.aspx" title="REGISTER" description="REGISTER"/>
          <siteMapNode url="~/Account/ForgotPassword.aspx" title="FORGOT PASS" description="FORGOT PASS" />
        </siteMapNode>
        <siteMapNode url="~/Administrator/Default.aspx" title="ADMIN"  description="ADMIN ">
          <siteMapNode url="~/Administrator/Laptops.aspx" title="LAPTOP" description="LAPTOP"/>
          <siteMapNode url="~/Administrator/Smartphones.aspx" title="SMARTPHONE" description="SMARTPHONE"/>
          <siteMapNode url="~/Administrator/Tablets.aspx" title="TABLETS" description="TABLETS"/>
          <siteMapNode url="~/Administrator/Cameras.aspx" title="CAMERAS" description="CAMERAS"/>
        </siteMapNode>
    </siteMapNode>
</siteMap>

メニュー:

.
.
.
<div id="menu_div" align="left" dir="ltr">
    <asp:Menu ID="Menu1" runat="server" BackColor="#C0BFBD" 
        DataSourceID="SiteMapDataSource1" DynamicHorizontalOffset="2" 
        Font-Names="Calibri" Font-Size="Medium" ForeColor="#2C2F36" 
        StaticSubMenuIndent="10px" RenderingMode="Table" 
        StaticEnableDefaultPopOutImage="False" style="margin-right: 0px" 
        Font-Bold="True" DisappearAfter="200">
        <DynamicHoverStyle BackColor="#282B32" ForeColor="White" />
        <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="3px" />
        <DynamicMenuStyle BackColor="#B5C7DE" />
        <DynamicSelectedStyle BackColor="Gray" />
        <DynamicItemTemplate>
            <%# Eval("Text") %>
        </DynamicItemTemplate>
        <StaticHoverStyle BackColor="#284E98" ForeColor="White" />
        <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="5px" />
        <StaticSelectedStyle BackColor="#70788B" />
    </asp:Menu>
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" 
        ShowStartingNode="False" />
</div>
4

0 に答える 0