menu background image problem with security trimming enabled sitemap

Last post 08-21-2008 7:13 PM by Dave Sussman. 3 replies.

Sort Posts:

  • menu background image problem with security trimming enabled sitemap

    08-21-2008, 5:42 PM
    • Member
      434 point Member
    • ashkant
    • Member since 06-10-2008, 7:32 AM
    • Posts 277

    hi all

    i have a sitemap with securityTrimmingEnabled="true"  . i use a background image for my menu ( for my div which  contains menu) like this:  

    <div style="background-image:url(Images/bgmenu.gif); ......

    this works for all pages that are allowed for everyone , but the pages that follow security rules can not show the background image. what should i use instead to see the picture in all of my pages?

     thank you

    Please remember to click “Mark as Answer” on the post that helps you
  • Re: menu background image problem with security trimming enabled sitemap

    08-21-2008, 6:22 PM
    • All-Star
      17,101 point All-Star
    • Dave Sussman
    • Member since 06-17-2002, 11:53 AM
    • UK
    • Posts 2,364
    • ASPInsiders
      TrustedFriends-MVPs

    I'm a little confused by what you mean. What do you mean by "to see the picture in all of my pages"?

    Any nodes that are trimmed by authorization won't appear in the menu, but the container div still shows, and therefore the background image shows, assuming the container is big enough to show the background image.

  • Re: menu background image problem with security trimming enabled sitemap

    08-21-2008, 6:52 PM
    • Member
      434 point Member
    • ashkant
    • Member since 06-10-2008, 7:32 AM
    • Posts 277

    i mean the picture of background. imagine that my menu in default page has it's background but in for example admin page the background isn't seen

    Please remember to click “Mark as Answer” on the post that helps you
  • Re: menu background image problem with security trimming enabled sitemap

    08-21-2008, 7:13 PM
    • All-Star
      17,101 point All-Star
    • Dave Sussman
    • Member since 06-17-2002, 11:53 AM
    • UK
    • Posts 2,364
    • ASPInsiders
      TrustedFriends-MVPs

    Ah right, so you don't want the image shown on when the admin pages are displayed. Probably the simplest way to do this is change the css class when on the admin pages. Let's assume I have a div containing my menu:

    <div id="nav" runat="server" class="nav">
      <asp:Menu ...
    </div>

    In my code I'd detect if I was in one of the admin pages, perhaps by checking to see if the path contained "/admin" (I tend to put all of my admin pages in a separate "admin" folder). If it is an admin page, I could just change the class:

    if (Request.Path.Contains("/admin/"))
      nav.class = "navAdmin";

    Then my CSS could be:

    .nav {
      /* normal formatting */
      backgroun-image: url(navimage.gif);
    }

    .navAdmin {
      /* normal formatting - no background-image */
    }

Page 1 of 1 (4 items)