How to fix this siteMap?

Discussion in 'ASP .Net Web Controls' started by active, Apr 5, 2007.

  1. active

    active Guest

    I've been reading the help but find much on programmiccally doing it but
    nothing on using XML.

    I have the following from an example and want to add a top menu item
    "History" and two menu items under that: History1 and History2. The top menu
    item should not open a page - simply show the two sub menu items. I know
    what I have is not right. I don't think I should even have a Top.aspx file.
    But I have no idea how to fix it.



    Can you help?



    <?xml version="1.0" encoding="utf-8" ?>

    <siteMap>

    <siteMapNode title="Home" url="Default.aspx">

    <siteMapNode title=" History" url="History/Top.aspx" />

    <siteMapNode title="History1" url="History/His 1.aspx" />

    </siteMapNode>

    <siteMapNode title="History2" url="History/His 2.aspx" />

    </siteMapNode>

    How to fix the above??






    <siteMapNode title="Links" url="Links.aspx" />

    <siteMapNode title="Albums" url="Albums.aspx" >

    <siteMapNode title="Photos" url="Photos.aspx" >

    <siteMapNode title="Details" url="Details.aspx" />

    </siteMapNode>

    </siteMapNode>

    <siteMapNode title="Register" url="Register.aspx" />

    <siteMapNode title="Login" url="Login.aspx" />

    <siteMapNode title="Manage" url="Admin/Albums.aspx" >

    <siteMapNode title="Photos" url="Admin/Photos.aspx" >

    <siteMapNode title="Details" url="Admin/Details.aspx" />

    </siteMapNode>

    </siteMapNode>

    </siteMapNode>


    </siteMap>
     
    active, Apr 5, 2007
    #1
    1. Advertising

  2. active

    Mike Mueller Guest

    I'm still learning how to use the sitemaps, so I do not know
    if this one will work. I did notice you have some whitespace
    in the URLs, and I would recommend that you lose it or
    replace it with hyphens or underscores

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap
    xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
    >

    <siteMapNode title="Home" url="Default.aspx">
    <siteMapNode title=" History" >
    <siteMapNode title=" History"
    url="History/Top.aspx" />
    <siteMapNode title="History1"
    url="History/His 1.aspx" />
    <siteMapNode title="History2"
    url="History/His 2.aspx" />
    </siteMapNode>
    </siteMapNode>
    </siteMap>




    " active" <> wrote in message
    news:e6%...
    : I've been reading the help but find much on
    programmiccally doing it but
    : nothing on using XML.
    :
    : I have the following from an example and want to add a top
    menu item
    : "History" and two menu items under that: History1 and
    History2. The top menu
    : item should not open a page - simply show the two sub menu
    items. I know
    : what I have is not right. I don't think I should even have
    a Top.aspx file.
    : But I have no idea how to fix it.
    :
    :
    :
    : Can you help?
    :
    :
    :
    : <?xml version="1.0" encoding="utf-8" ?>
    :
    : <siteMap>
    :
    : <siteMapNode title="Home" url="Default.aspx">
    :
    : <siteMapNode title=" History" url="History/Top.aspx" />
    :
    : <siteMapNode title="History1" url="History/His 1.aspx" />
    :
    : </siteMapNode>
    :
    : <siteMapNode title="History2" url="History/His 2.aspx" />
    :
    : </siteMapNode>
    :
    : How to fix the above??
    :
    :
    :
    :
    :
    :
    : <siteMapNode title="Links" url="Links.aspx" />
    :
    : <siteMapNode title="Albums" url="Albums.aspx" >
    :
    : <siteMapNode title="Photos" url="Photos.aspx" >
    :
    : <siteMapNode title="Details" url="Details.aspx" />
    :
    : </siteMapNode>
    :
    : </siteMapNode>
    :
    : <siteMapNode title="Register" url="Register.aspx" />
    :
    : <siteMapNode title="Login" url="Login.aspx" />
    :
    : <siteMapNode title="Manage" url="Admin/Albums.aspx" >
    :
    : <siteMapNode title="Photos" url="Admin/Photos.aspx" >
    :
    : <siteMapNode title="Details" url="Admin/Details.aspx" />
    :
    : </siteMapNode>
    :
    : </siteMapNode>
    :
    : </siteMapNode>
    :
    :
    : </siteMap>
    :
    :
     
    Mike Mueller, Apr 5, 2007
    #2
    1. Advertising

  3. active

    active Guest

    Thanks to both of you.

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode title="History">
    <siteMapNode url="history1.aspx" title="History 1" />
    <siteMapNode url="history2.aspx" title="History 2" />
    </siteMapNode>
    </siteMap>

    The above works but below doesn't

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode title="Home" url="Default.aspx" />
    <siteMapNode title="History">
    <siteMapNode url="History/One.aspx" title="One" />
    <siteMapNode url="History/Two.aspx" title="Two" />
    </siteMapNode>
    </siteMap>


    The addition makes History an "invalid child element"
    If I put Home below </siteMapNode>
    it becomes the invalid one.

    I've tried two </siteMapNode>
    I've tried other things, it appears that the second main level item is
    always the problem.


    Thanks again for the replies
     
    active, Apr 6, 2007
    #3
  4. active

    active Guest

    I can make it work.
    Take off the / before the >
    And add a url to History.
    Not sure why I need the url!
    Thanks again for the help



    " active" <> wrote in message
    news:...
    > Thanks to both of you.
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    > <siteMapNode title="History">
    > <siteMapNode url="history1.aspx" title="History 1" />
    > <siteMapNode url="history2.aspx" title="History 2" />
    > </siteMapNode>
    > </siteMap>
    >
    > The above works but below doesn't
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    > <siteMapNode title="Home" url="Default.aspx" />
    > <siteMapNode title="History">
    > <siteMapNode url="History/One.aspx" title="One" />
    > <siteMapNode url="History/Two.aspx" title="Two" />
    > </siteMapNode>
    > </siteMap>
    >
    >
    > The addition makes History an "invalid child element"
    > If I put Home below </siteMapNode>
    > it becomes the invalid one.
    >
    > I've tried two </siteMapNode>
    > I've tried other things, it appears that the second main level item is
    > always the problem.
    >
    >
    > Thanks again for the replies
    >
    >
    >
     
    active, Apr 6, 2007
    #4
  5. active

    active Guest

    I think I now know that sometime there is no ending slash, like in
    <siteMapNode title="Home" url="Default.aspx">
    and that a
    </siteMapNode>
    closes it.

    I believe not noticing that caused my problem.

    I want to thank you again for your help.





    "Mike Mueller" <> wrote in message
    news:uRw%...
    > I'm still learning how to use the sitemaps, so I do not know
    > if this one will work. I did notice you have some whitespace
    > in the URLs, and I would recommend that you lose it or
    > replace it with hyphens or underscores
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <siteMap
    > xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
    > >

    > <siteMapNode title="Home" url="Default.aspx">
    > <siteMapNode title=" History" >
    > <siteMapNode title=" History"
    > url="History/Top.aspx" />
    > <siteMapNode title="History1"
    > url="History/His 1.aspx" />
    > <siteMapNode title="History2"
    > url="History/His 2.aspx" />
    > </siteMapNode>
    > </siteMapNode>
    > </siteMap>
    >
    >
    >
    >
    > " active" <> wrote in message
    > news:e6%...
    > : I've been reading the help but find much on
    > programmiccally doing it but
    > : nothing on using XML.
    > :
    > : I have the following from an example and want to add a top
    > menu item
    > : "History" and two menu items under that: History1 and
    > History2. The top menu
    > : item should not open a page - simply show the two sub menu
    > items. I know
    > : what I have is not right. I don't think I should even have
    > a Top.aspx file.
    > : But I have no idea how to fix it.
    > :
    > :
    > :
    > : Can you help?
    > :
    > :
    > :
    > : <?xml version="1.0" encoding="utf-8" ?>
    > :
    > : <siteMap>
    > :
    > : <siteMapNode title="Home" url="Default.aspx">
    > :
    > : <siteMapNode title=" History" url="History/Top.aspx" />
    > :
    > : <siteMapNode title="History1" url="History/His 1.aspx" />
    > :
    > : </siteMapNode>
    > :
    > : <siteMapNode title="History2" url="History/His 2.aspx" />
    > :
    > : </siteMapNode>
    > :
    > : How to fix the above??
    > :
    > :
    > :
    > :
    > :
    > :
    > : <siteMapNode title="Links" url="Links.aspx" />
    > :
    > : <siteMapNode title="Albums" url="Albums.aspx" >
    > :
    > : <siteMapNode title="Photos" url="Photos.aspx" >
    > :
    > : <siteMapNode title="Details" url="Details.aspx" />
    > :
    > : </siteMapNode>
    > :
    > : </siteMapNode>
    > :
    > : <siteMapNode title="Register" url="Register.aspx" />
    > :
    > : <siteMapNode title="Login" url="Login.aspx" />
    > :
    > : <siteMapNode title="Manage" url="Admin/Albums.aspx" >
    > :
    > : <siteMapNode title="Photos" url="Admin/Photos.aspx" >
    > :
    > : <siteMapNode title="Details" url="Admin/Details.aspx" />
    > :
    > : </siteMapNode>
    > :
    > : </siteMapNode>
    > :
    > : </siteMapNode>
    > :
    > :
    > : </siteMap>
    > :
    > :
    >
    >
     
    active, Apr 6, 2007
    #5
  6. active

    active Guest

    I think I now know that sometime there is no ending slash, like in
    <siteMapNode title="Home" url="Default.aspx">
    and that a
    </siteMapNode>
    closes it.

    I believe not noticing that caused my problem.

    I want to thank you again for your help.
     
    active, Apr 6, 2007
    #6
  7. active

    active Guest

    thanks

    "David Longnecker" <> wrote in message
    news:...
    > Your <siteMapNode title="History"> doesn't have the /> because the /> is a
    > closing tag. Your "child nodes" would be ignored. The </siteMapNode>
    > encapsulates the child nodes and acts as the closing tag for this
    > scenario; this is commonly called a container tag.
    >
    > You typically only use the <tag attribute="value" /> layout for tags
    > commonly called empty tags.
    >
    >
    > ---
    > David R. Longnecker
    > Web Developer
    > http://blog.tiredstudent.com
    >
    >> I can make it work.
    >> Take off the / before the >
    >> And add a url to History.
    >> Not sure why I need the url!
    >> Thanks again for the help
    >> " active" <> wrote in message
    >> news:...
    >>
    >>> Thanks to both of you.
    >>>
    >>> <?xml version="1.0" encoding="utf-8" ?>
    >>> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
    >>> >
    >>> <siteMapNode title="History">
    >>> <siteMapNode url="history1.aspx" title="History 1" />
    >>> <siteMapNode url="history2.aspx" title="History 2" />
    >>> </siteMapNode>
    >>> </siteMap>
    >>> The above works but below doesn't
    >>>
    >>> <?xml version="1.0" encoding="utf-8" ?>
    >>> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
    >>> >
    >>> <siteMapNode title="Home" url="Default.aspx" />
    >>> <siteMapNode title="History">
    >>> <siteMapNode url="History/One.aspx" title="One" />
    >>> <siteMapNode url="History/Two.aspx" title="Two" />
    >>> </siteMapNode>
    >>> </siteMap>
    >>> The addition makes History an "invalid child element"
    >>> If I put Home below </siteMapNode>
    >>> it becomes the invalid one.
    >>> I've tried two </siteMapNode>
    >>> I've tried other things, it appears that the second main level item
    >>> is
    >>> always the problem.
    >>> Thanks again for the replies
    >>>

    >
    >
     
    active, Apr 9, 2007
    #7
    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. Xah Lee
    Replies:
    22
    Views:
    1,155
    Tim Roberts
    Mar 21, 2006
  2. Xah Lee
    Replies:
    23
    Views:
    1,105
    Tim Roberts
    Mar 21, 2006
  3. AmitKu
    Replies:
    1
    Views:
    817
    Cowboy \(Gregory A. Beamer\)
    Sep 27, 2006
  4. Learner
    Replies:
    5
    Views:
    290
    Dominick Baier [DevelopMentor]
    May 7, 2006
  5. Xah Lee
    Replies:
    21
    Views:
    828
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page