public class ben:harrell

July 27, 2006

Usability and ASP.NET Site Navigation

Filed under: .NET, Design, Uncategorized, Usability — benjamin harrell @ 6:50 pm

I recently started looking into ASP.NET Site Navigation and the sitemap controls.  Orginally, discounted the sitemap control as something you would drop on a page called sitemap and never touch again but boy was I wrong.  Site Navigation is an entire API for controlling site naviation in a consitent and near drag and drop manner.  And as usual, the 2.0 team hit another home run witht he Provider model allowing you to drive your Sitemap data from any source (XML out of the box but there are already multiple SQL implementations but my favorite is Jeff Prosise’s found here for MSDN magazine).  So what does this have to do with Usability?  Well, today I noticed something very related to Usability in the real world and it immediately hit me that we as developers make the same mistake all the time.  What cardinal Usability sin am I talking about?  Don’t put it there if I am not supposed to use it! I noticed an irate man yanking on a fancy, obvious door ‘pull bar’ and in small print next to it was printed ‘Push’.  Sure it makes for a great joke and even a classic Far Side but this really is a design/usability error!  Why wasn’t there a flat panel that said ‘Push’ on it?  Why the pull bar!!!  Ok so what does this have to do with Site Navigation….well, only the coolest feature in my opinion:

 ASP.NET 2.0’s site navigation provides a feature called security trimming. When obtaining site map information with security trimming enabled, only those site map nodes that the currently logged on user has authorization to visit are available. That means the site’s TreeView or Menu will contain just those sections accessible by the currently logged in user.

I pulled this from a great series on Site Navigation here

Really all you have to do is turn on SecurityTrimming in the web.config as shown below:

 <siteMap defaultProvider=”XmlSiteMapProvider” enabled=”true”>
   <providers>    
     <add name=”XmlSiteMapProvider”      
       description=”Default SiteMap provider.”  
       type=”System.Web.XmlSiteMapProvider”  
       siteMapFile=”siteMapFileName”      
       securityTrimmingEnabled=”true” />  
   </providers>
</siteMap>

That’s it!  Of course you have the ability to override for certain items but I’ll leave that as an exercise to the reader.  Now all we need is a good visual studio Add-In to generate a sitemap file or SQL database script from my current website project…I guess I better get that project started!

Advertisements

1 Comment »

  1. Wouldn’t this have been useful on that will-remain-anonymous-internal-web-app that we worked on about 18 months ago?

    I love the notion of pointing to a table in the database that stores a mapping of pages and user context identifiers and roles information telling me if a given user can see the page or not.

    ASP.NET 2.0 is converting me from a strict Smart Client fundamentialist to be a little more open minded about different delivery choices in software.

    Comment by Patrick Altman — July 27, 2006 @ 7:48 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: