SqlSiteMapProvider

Discussion in 'ASP .Net' started by SteveL, Mar 5, 2006.

  1. SteveL

    SteveL Guest

    Hi,
    I'm using the SqlSiteMapProvider to get my site map from sql 2005 rather
    than the default web.sitemap xml file. I understand that in order to do a
    cache dependency on my tables I need to ensure that the asp.net worker
    process has dbo rights on my database, which I don't want to do. Therefore,
    I'm not using this functionality.

    My question is how can I programatically clear the sitemap cache so that the
    database is re-queried depending on which user is accessing my site.

    Appreciate your help.

    Steve
     
    SteveL, Mar 5, 2006
    #1
    1. Advertising

  2. This MSDN Mag article by Jeff Prosise pretty much covers everything you want
    to do :

    http://msdn.microsoft.com/msdnmag/issues/06/02/WickedCode/default.aspx

    --Peter
    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "SteveL" wrote:

    > Hi,
    > I'm using the SqlSiteMapProvider to get my site map from sql 2005 rather
    > than the default web.sitemap xml file. I understand that in order to do a
    > cache dependency on my tables I need to ensure that the asp.net worker
    > process has dbo rights on my database, which I don't want to do. Therefore,
    > I'm not using this functionality.
    >
    > My question is how can I programatically clear the sitemap cache so that the
    > database is re-queried depending on which user is accessing my site.
    >
    > Appreciate your help.
    >
    > Steve
    >
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Mar 5, 2006
    #2
    1. Advertising

  3. SteveL

    SteveL Guest

    Thanks for the reply but unless I'm missing it somewhere this code shows you
    how to use the sql dependency. It doesn't show you how to clear the cache
    using code.

    For example if I add this code to a button:
    SqlSiteMapProvider l = new SqlSiteMapProvider();

    l.OnSiteMapChanged("__SiteMapCacheDependency", null,
    System.Web.Caching.CacheItemRemovedReason.DependencyChanged);

    It will not clear the cached menu. Also if the item is cached different
    users have different views of the menu depending on whether they are logged
    in etc and this might not be as straightforward as adding a role in the
    SiteMap table. The menu item might belong to lots of roles, which would
    mean that the stored proc to get the sitemap might have different logic in.
    Therefore, this doesn't seem very flexible as I might want to store the map
    in a user session rather than an application wide cache.

    Appreciate your help as I might be completely overlooking the obvious.

    Steve



    "Peter Bromberg [C# MVP]" <> wrote in message
    news:...
    > This MSDN Mag article by Jeff Prosise pretty much covers everything you
    > want
    > to do :
    >
    > http://msdn.microsoft.com/msdnmag/issues/06/02/WickedCode/default.aspx
    >
    > --Peter
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "SteveL" wrote:
    >
    >> Hi,
    >> I'm using the SqlSiteMapProvider to get my site map from sql 2005 rather
    >> than the default web.sitemap xml file. I understand that in order to do
    >> a
    >> cache dependency on my tables I need to ensure that the asp.net worker
    >> process has dbo rights on my database, which I don't want to do.
    >> Therefore,
    >> I'm not using this functionality.
    >>
    >> My question is how can I programatically clear the sitemap cache so that
    >> the
    >> database is re-queried depending on which user is accessing my site.
    >>
    >> Appreciate your help.
    >>
    >> Steve
    >>
    >>
    >>
     
    SteveL, Mar 6, 2006
    #3
    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. Rahul

    SQLsiteMapProvider Cache Problem

    Rahul, Apr 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,587
    =?Utf-8?B?UGhhdFQ=?=
    Apr 19, 2006
  2. =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=

    SqlSiteMapProvider question for menu control

    =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=, Aug 17, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    497
    =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
    Aug 17, 2007
  3. Mark B
    Replies:
    0
    Views:
    865
    Mark B
    Sep 5, 2008
  4. rote
    Replies:
    0
    Views:
    347
  5. Dave
    Replies:
    0
    Views:
    416
Loading...

Share This Page