Multple roles on a SiteMapNode

Discussion in 'ASP .Net' started by Cal Who, Feb 2, 2010.

  1. Cal Who

    Cal Who Guest

    I've been setting one role on a SiteMapNode elements but now I'd like to add
    multiple roles to an element.

    That is Roles="Admin, Fixer"

    I'd do this rather that putting all Admins into the Fixer role.

    I've read the documentation and it sounds like a IList constructor would do
    it but I can't find out the details.

    Is it possible to do and if so, how can I do that?

    Thanks
     
    Cal Who, Feb 2, 2010
    #1
    1. Advertising

  2. On Feb 2, 5:43 pm, " Cal Who" <> wrote:
    > I've been setting one role on a SiteMapNode elements but now I'd like to add
    > multiple roles to an element.
    >
    > That is Roles="Admin, Fixer"
    >
    > I'd do this rather that  putting all Admins into the Fixer role.
    >
    > I've read the documentation and it sounds like a IList constructor would do
    > it but I can't find out the details.
    >
    > Is it possible to do and if so, how can I do that?
    >
    > Thanks


    You should be able to specify multiple roles delimited by comma or
    semi-colon as you have already.

    The SiteMapNode.Roles Property expects an IList of roles of
    System.Collections.IList
    http://msdn.microsoft.com/en-us/library/system.web.sitemapnode.roles.aspx

    Hope this helps
     
    Alexey Smirnov, Feb 2, 2010
    #2
    1. Advertising

  3. Cal Who

    Cal Who Guest

    "Alexey Smirnov" <> wrote in message
    news:...
    On Feb 2, 5:43 pm, " Cal Who" <> wrote:
    > I've been setting one role on a SiteMapNode elements but now I'd like to
    > add
    > multiple roles to an element.
    >
    > That is Roles="Admin, Fixer"
    >
    > I'd do this rather that putting all Admins into the Fixer role.
    >
    > I've read the documentation and it sounds like a IList constructor would
    > do
    > it but I can't find out the details.
    >
    > Is it possible to do and if so, how can I do that?
    >
    > Thanks


    You should be able to specify multiple roles delimited by comma or
    semi-colon as you have already.

    The SiteMapNode.Roles Property expects an IList of roles of
    System.Collections.IList
    http://msdn.microsoft.com/en-us/library/system.web.sitemapnode.roles.aspx

    Hope this helps



    ==

    I had seen that before but did not understand the following which it
    includes:

    You can use the #ctor(SiteMapProvider, String, String, String, String,
    IList, NameValueCollection, NameValueCollection) constructor to supply a
    list of roles to the SiteMapNode object when it is first created.

    I found "ctor" used many times on the Internet (without the #) but no
    definition.

    Reading about IList didn't help.

    I'll try simply using Roles="Admin, Fixer"

    but would feel better about it if I could find some documentation I could
    understand.



    Thanks
     
    Cal Who, Feb 2, 2010
    #3
  4. On Feb 2, 8:22 pm, " Cal Who" <> wrote:
    >
    > I had seen that before but did not understand the following which it
    > includes:
    >
    > You can use the #ctor(SiteMapProvider, String, String, String, String,
    > IList, NameValueCollection, NameValueCollection) constructor to supply a
    > list of roles to the SiteMapNode object when it is first created.
    >
    > I found "ctor" used many times on the Internet (without the #) but no
    > definition.
    >


    It's a typo, stays for "constructor", I believe. You can use the
    constructor to supply... etc.

    IList is a general type of collection.


    > Reading about IList didn't help.
    >
    > I'll try simply using Roles="Admin, Fixer"
    >
    > but would feel better about it if I could find some documentation I could
    > understand.
    >
    > Thanks
     
    Alexey Smirnov, Feb 2, 2010
    #4
  5. Cal Who

    Cal Who Guest

    "Alexey Smirnov" <> wrote in message
    news:...
    On Feb 2, 8:22 pm, " Cal Who" <> wrote:
    >
    > I had seen that before but did not understand the following which it
    > includes:
    >
    > You can use the #ctor(SiteMapProvider, String, String, String, String,
    > IList, NameValueCollection, NameValueCollection) constructor to supply a
    > list of roles to the SiteMapNode object when it is first created.
    >
    > I found "ctor" used many times on the Internet (without the #) but no
    > definition.
    >


    It's a typo, stays for "constructor", I believe. You can use the
    constructor to supply... etc.

    IList is a general type of collection.


    > Reading about IList didn't help.
    >
    > I'll try simply using Roles="Admin, Fixer"
    >
    > but would feel better about it if I could find some documentation I could
    > understand.
    >
    > Thanks



    I read the documentation for the SiteMapNode Constructor and then that for
    IList and just couldn't justify the a simple comma seperated list would
    work. But it does and I just have to await an enlightment in the future.

    Thanks a lot
     
    Cal Who, Feb 2, 2010
    #5
    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. Luis Esteban Valencia

    Transactions between multple servers.

    Luis Esteban Valencia, Oct 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    299
    Roberto Lopes
    Oct 27, 2004
  2. =?Utf-8?B?QXJnaXJvcA==?=

    Multple postbacks

    =?Utf-8?B?QXJnaXJvcA==?=, Nov 11, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    422
    Daniel Walzenbach
    Nov 11, 2005
  3. davout
    Replies:
    0
    Views:
    421
    davout
    Apr 30, 2004
  4. Jon Edney

    ASP.NET 2.0 Beta 1 <siteMapNode> roles=""

    Jon Edney, Apr 12, 2005, in forum: ASP .Net Security
    Replies:
    3
    Views:
    250
    Brock Allen
    Apr 12, 2005
  5. Fendi Baba
    Replies:
    2
    Views:
    90
    Lachlan Hunt
    Mar 26, 2005
Loading...

Share This Page