path reference issue with a single masterpage and subfolders on a

Discussion in 'ASP .Net' started by markm75, May 6, 2008.

  1. markm75

    markm75 Guest

    There is probably some simple answer to my question, but i'm still new to
    this a bit..

    I have a master page.. with a menu system which is coded onto the
    masterpage.aspx... it uses A tags with hrefs etc.. the usual stuff..

    I also have a sub section on the site.. where aspx files arent in the
    root.. ie: /rootfiles.aspx here.. then /subsection/subfiles.aspx

    The menu is fine and dandy with the usual relative references like <a
    href="default.aspx" > for the root page.. but when you are say
    /subsection/subfiles.aspx all the menu items paths are incorrect.

    So at this point i figure i have two or 3 choices.. I could one, make a
    seperate masterpage in the subsection (not desired).. or.. I can just do a
    search in the request.path variable for the word "subsection" and if it
    exists, then dynamically change all the menu items href paths to the correct
    format.. ie: if in a subsection, href becomes ./default.aspx for the root
    page..

    In doing this second option, it seems i have to do the same thing on the
    masterpage.aspx.. as there is a <link css/file.css> reference in there and
    this cant be changed, only on the aspx file itself (ie: i cant reference it
    in codebehind in the page load event).

    Any thoughts on this? If these options are the best ones.. would it be a
    bad idea to make all the menu links runat="server", so that i can access the
    href property from the page load event and set all the values in that
    procedure.. or would i be just as good to do all the checks in the embedded
    c# code in the aspx page itself.. albeit a bit more messy but all client side?

    Thanks
    markm75, May 6, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    MasterPage -> Page -> MasterPage Code Access

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    7,853
    Steven Cheng[MSFT]
    Apr 14, 2006
  2. ThunderMusic
    Replies:
    2
    Views:
    422
    Gregory Gadow
    Sep 27, 2006
  3. Randy Smith
    Replies:
    9
    Views:
    405
    Mark Rae
    Apr 14, 2007
  4. mr t
    Replies:
    0
    Views:
    381
  5. Torben Laursen
    Replies:
    4
    Views:
    560
    clintonG
    Mar 15, 2008
Loading...

Share This Page