473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

SqlSiteMapProvider

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
Mar 5 '06 #1
2 3917
This MSDN Mag article by Jeff Prosise pretty much covers everything you want
to do :

http://msdn.microsoft.com/msdnmag/is...e/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

Mar 5 '06 #2
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.Dependen cyChanged);

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]" <pb*******@yahoo.nospammin.com> wrote in message
news:B8**********************************@microsof t.com...
This MSDN Mag article by Jeff Prosise pretty much covers everything you
want
to do :

http://msdn.microsoft.com/msdnmag/is...e/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

Mar 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: fernandezr | last post by:
I've successfully created a dynamic menu pulling data from a database however all links thus far have all been virtual urls such as /ABCD/default.aspx, /ABCD/profile.aspx, etc. Now I want to add...
3
by: fernandezr | last post by:
I have a navigation user control built using a sqlsitemap in our site's master page. After a user logs in the control doesn't refresh the data in the leftside navigation links. I found I can...
1
by: Joey | last post by:
Does anyone know how to hide/show parent items in the new asp.net 2.0 menu control that comes with Visual Studio 2005? I want to be able to show/hide an admin menu based upon whether the user in an...
7
by: GopherGold | last post by:
I have a site that uses a combination of Web.Sitemap and a SqlSiteMapProvider that I created (thanks to Jeff Proisse @ MSDN). One node of the Web.Sitemap is the same as the root node from the...
1
by: Rahul | last post by:
Hi I have a SQLServerSiteMapProvider code from one of the guru's from microsoft, So i am successfully getting the records in my Menu control which is reffering to SQLServerSIteMapProvider. ...
2
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I need to translate thi control into vb.net code and i'm having a little trouble. (by the way, i love the example) Specificly I'm not sure how to translate this statement: // Create a dictionary...
1
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi guys, So the ever-lasting problem has remained until now - how to create a dynamic sitemap from information stored in a database. Microsoft's MSDN magazine covered how to do this using a...
7
by: Mark B | last post by:
How do I have a SiteMap based on the output of a stored procedure? (I want to pass a @LanguageCode parameter to it so it will display the top Menu in the appropriate language).
0
by: rote | last post by:
I'm trying to implemenet a navigation control using SqlSiteMapProvider like below http://www.eggheadcafe.com/tutorials/aspnet/028e14ef-ee6a-4317-aa14-227d5d753712/treeview-navigation---sq.aspx I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.