Thursday, March 23, 2006

Today I found out that I will be attending TechEd 2006 in Boston.  Thanks of course to my new employer Pets Best Pet Insurance.  I am looking forward to seeing many friends again and checking out the latest and greatest technologies.  Look for me at the Windows Workflow Foundation and other WinFX sessions.  I will probably hit an IIS 7 session or 2 as well.  Of course I will probably spend a fair amount of time in the cabana area also.

If you are going to be there and would like to say hello in person then lets meet up.

3/23/2006 10:57:03 PM (Mountain Daylight Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Friday, March 03, 2006

Time is nearing for the first Boise Code Camp.  I will be doing 2 presentations on DotNetNuke and several others will be presenting a lot of other great material.  I put a lot of effort in getting door prizes for the event.  We are close to having enough prizes that most attendees should go home with something.  Of course the session material is the most valuable aspect, but winning a copy of Visual Studio Team Suite with MSDN wouldn't hurt either.

3/3/2006 10:19:09 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

This week I started reading Professional ASP.NET 2.0 Security, Membership, and Role Management by Stefan Schackow.  I can't recommend this book enough.  Stefan is a great guy as well.  I had opportunity to meet him on a couple different visits to Redmond.  I wish I had this book 2 years ago when I started looking at the Membership and Role API's in .NET 2.0.  (Yes, I was looking these things 2 years ago.  They were announced at the PDC in Oct. 2003).

Today I found a bonus nugget of goodness I had to share that is indirectly related to ASP.NET 2.0 security.  On Page 429 Stefan explains why all the SQL objects in the Microsoft SQL providers for .NET 2.0 explicitly reference DBO as the object owner.  (ex. dbo.aspnet_Memberhsip)  It turns out that SQL 2000 takes a performance hit if the object owners are not explicitly declared in stored procedures, views, etc.  The performance hit is significant enough that Microsoft did a QFE on ASP.NET 1.1 SQL Session state.  I had no idea and I figured many others also were clueless about the patch for Session State as well as the performance issue.

Check out Todd Carter's blog for some more details.  It also includes a link to the .NET 1.1 Session State fix.

3/3/2006 10:11:53 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, January 20, 2006

This week has been absolutely amazing.  Sr. level .NET developer jobs are showing up everywhere.  Here is a list off the top of my head.

Amphire
Healthwise
Micron
Comsys
TEK systems
Idaho Commerce and Labor
Innova Systems International
WillowTree Software
neoreef

1/20/2006 11:55:42 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, January 12, 2006

.NET guru Scott Hanselman has started a new podcast.  No excuses, just get over there and subscribe to it.

www.hanselminutes.com

1/12/2006 10:20:34 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

I checked today and the script I wrote yesterday is working!  I was feeding the entire URI to the tracker which makes the document path show up with the protocol as the folder name in the tool.  I decided to modify the TrackIt function slightly.  I am peeling off the protocol from the link and prepending it with my own folder name to make it easy to distinguish document downloads for other content.

Enjoy!

function TrackIt(link)
{
// Remove the conversion to Lowercase if you are on a Case sensitive web server
var slashes = link.href.indexOf("//") + 2;
var docPath = link.href.toLowerCase().substring(slashes, link.href.length);
urchinTracker(
"/#docs/" + docPath);
}

1/12/2006 9:42:59 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, January 11, 2006

Previously I blogged about possible solutions for tracking downloads with Google Analytics.  The solution I am going to experiment with first is to dynamically add the tracking code to my download links via JavaScript.  I spent quite a bit of time on my script to make it cross-browser compatible and so that it would handle proper timing of execution based on the loading of the links.  I also used a regular expression to limit the tracking to specific link types.  Hopefully those match most cases.  If all goes well I will probably wrap all of this into a simple ASP.NET control that can be added to an page you want tracked. 

First off you need the standard Google tracking scripts:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-XXXXXX-X";
urchinTracker();
</script>

Second is my new download tracking script.  I have placed it in a separate file for browser caching and easy updating.  Also it has the defer="defer" attribute so that IE will not load the script until the content has finished loading.  XHTML compliance required me to include a value for the attribute.  Please let me know if you come up with any improvements to the script or if you find any errors.  Thanks to quirksmode for info on the dynamic event models and dean edwards for info on deferred script execution.

<script type="text/javascript" src="downloadtracker.js" defer="defer"></script>

Here is the actual downloadtracker.js code

// We dont want the try adding the tracking code until the page links are loaded
if (document.addEventListener) {
document.addEventListener(
"DOMContentLoaded", addEvents, null); // Firefox
} else {
addEvents();
// IE : Call the function immediately because the script is referenced with the defer attribute supported by IE
}

function addEvents()
{
// quit if this function has already been called
if (arguments.callee.done) return;
// flag this function so we don't do the same thing twice
arguments.callee.done = true;
for (i=0; i <document.links.length; i++)
{
var x = document.links[i];
// Only attach tracking code to specific file types
var extensions = new RegExp(".+\.(zip|pdf|xls|doc|csv|txt|ppt|xml|rtf)$");
var doc = x.href.toLowerCase().match(extensions);
if (doc)
{
if (x.attachEvent)
{
x.attachEvent(
'onclick', function () {TrackIt(window.event.srcElement)}); // IE
} else {
x.addEventListener(
'click', function () {TrackIt(this)}, false); // Firefox
}
}
}
}

function TrackIt(link)
{
// Remove the conversion to Lowercase if you are on a Case sensitive web server
urchinTracker(link.href.toLowerCase());
}

1/11/2006 12:02:45 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Friday, January 06, 2006

Rick Strahl says: Get Excited About IIS 7.0.  Having seen it myself I wholeheartedly agree. 

1/6/2006 9:05:05 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, December 01, 2005

Like many others I am trying Google Analytics.  I first heard of the JavaScript tracking technique with LiveStats 7.  One feature that kept me from liking the technique they use for tracking is that it is difficult to track file downloads.  I work with a lot of content management systems that would require quite a bit of modification to add the required scripts to file download links.  However, the information you can get from this tracking technique is otherwise far superior to anything you can ever get from  traditional log analysis.  Ideally I would like to dynamically add the tracking code to all download links in my content.  The 2 ideas floating in my head at the moment are:

#1  Add an ISAPI filter in IIS that would parse all output and add the tracking code to any download links that match RegEx patterns.  Perhaps all PDF download links for example.

#2  If possible, use JavaScript injected in the content pages to dynamically add events like onClick to elements like the anchor tag.  I already have to inject the tracker scripts so it would be great if I could inject a page parser script as well. 

Anyone have other ideas or thoughts on the possibility of these options?  I don't do ISAPI so #1 is out for me unless I can hire it out.

12/1/2005 11:47:57 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, November 23, 2005

It seems like forever ago that I started recommending Fredrik Normen's Permission Manager.  Recently I was tasked to find a way to restrict nodes in a SiteMap based on Permission.  Today I completed that task and thought I would share it with the world.  First of all, I appoligize for writing the code in VB.NET (employers standard), but you can all compile it and reference it from C# so get over it.

What I did to create the PermissionXmlSiteMapProvider was to inherit directly from XmlSiteMapProvider and then extend 2 methods.  First of all I extended the Initialize method so that I could verify that it was configured properly.  Since it is dependent on the presence of Permission Manager and it properly working I added a simple check to verify that it has a provider.

The second method to override for the addtion of Permission to a SiteNode was IsAccessibleToUser.  Thankfully the siteNode can have extra attributes on it without complaint.  I used that to check for the permission attribute.  If it is there then a call to Permission Manager is done for the named permission and the currently logged in user.

After configuring my applications to use my new Provider I restrict access to nodes as easy as this:

<siteMapNode url="Edit.aspx" title="Edit" permission="Modify" />

Since I built on top of the XmlSiteMapProvider I also get the ability to do Roles restriction and a combination of Roles and permission:

<siteMapNode url="Delete.aspx" title="Delete" Roles="Admins, Editors" permission="Delete" />

It is important to note a few things that I ran into while working on this solution.  You must enable Security Trimming.  If you will restrict based on Roles you also must enable RoleManager.  Restricting via Roles is a little quirky as described in the MSDN Site Map Providers document.  Specifically review the Security Trimming section.

Here is the siteMap section of Web.config that implements the PermssionXmlSiteMapProvider:

<siteMap enabled="true" defaultProvider="PersmissionXmlSiteMapProvider">
  <
providers>
    <
add name="PersmissionXmlSiteMapProvider
           
type="IDCL.Web.Security.PersmissionXmlSiteMapProvider, IDCL.Web"
           
description="Permission xml site map provider"
          
securityTrimmingEnabled="true"
          
siteMapFile="Web.sitemap"/>
  providers>
siteMap>

Obviously you also need to have Permission Manager installed and configured or this will not work.

Here is the code for the provider:

Imports System
Imports System.Web
Imports System.Configuration.Provider
Imports System.Web.Configuration
Imports Nsquared2.Security

Public Class PersmissionXmlSiteMapProvider
Inherits XmlSiteMapProvider

Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)

' Verify that config isn't null
If config Is Nothing Then
  Throw New ArgumentNullException("config")
End If

' Verify that Permission Manager is configured
If PermissionManager.Provider Is Nothing Then
  Throw New ProviderException("Permission Manager default provider missing.")
End If

' Add a default "description" attribute to config if the
' attribute doesn't exist or is empty
If String.IsNullOrEmpty(config("description")) Then
  config.Remove("description")
  config.Add(
"description", "PermissionXmlSiteMap provider")
End If

' Call the base class's Initialize method
MyBase.Initialize(name, config)
End Sub

Public Overrides Function IsAccessibleToUser(ByVal context As System.Web.HttpContext, ByVal node As System.Web.SiteMapNode) As Boolean

  Dim authorized As Boolean = MyBase.IsAccessibleToUser(context, node)

  'Pull the permission out of the sitemap node as an attribute
  Dim Permission As String = node.Item("permission")
  If Not Permission Is Nothing And authorized Then
    If context.User.Identity.IsAuthenticated Then
      ' Only check permission for known users
      Return PermissionManager.HasUserPermission(context.User.Identity.Name, Permission)
    Else
      ' The presence of a permission requires a known user
      Return False
    End If
  End If

Return authorized

End Function
End
Class

The PermissionSiteMapProvider.zip file with this article includes the Provider solution and a sample web.config

11/23/2005 4:27:33 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, November 22, 2005
I love my Zen Micro.  Tiger Direct has one now for $129.99 after rebate.  Get one of these and then sign up for Yahoo Music Unlimited for a year while the price is still only $59.88.  You won't be disappointed!
11/22/2005 8:13:31 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, November 10, 2005

Today I discovered that Microsoft is answering the community rant against losing web projects in VS 2005.  They have introduced Web Deployment Projects as an add-in for VS 2005.  They have essentially wrapped MS Build into a project type for the web.  Most exciting is that they did us right and took it beyond just providing a way to do exclusions and assembly naming.  My favorite new thing is the ability to do configuration management as part of the build process.  I can now have multiple configuration documents that target different deployment options.  Thank you ScottGu and the ASP.NET team!  This is exactly the kind of thing that we needed!

11/10/2005 10:02:31 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Monday, November 07, 2005

Today is the official launch date for Microsoft Visual Studio 2005 and SQL 2005.  The team at DotNetNuke surprised us all be releasing their newest builds today as well.  Most surprising was the 4.0 release which runs on the .NET 2.0 framework.  I hadn't expected that for a few months still, but I am thrilled to see it.  I will be pushing hard at the office now to move from Beta 2 to the final release of .NET 2.0 so that we can run DNN 4.0 and begin building ASP.NET 2.0 modules.  Thanks DNN crew for your relentless efforts on this product.

11/7/2005 11:32:53 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Thursday, October 27, 2005

DotNetNuke (DNN) has an ISearchable interface that module developers can implement to allow their content to be indexed by the internal search system. 

This system has some significant limitations with the way it handles indexing.  Since it is not crawler driven it does not index anything except the text explicitly fed to it through modules that implement ISearchable.  You could give your page a great title and the search will never find it.  In fact the only thing I like about the ISearchable solution is that is can be made security aware and that it is provider based.  Of course if you attempt to use a different provider you are still limited by the overall solution, so even that is not great.

My next big frustration with ISearchable is that it is used to tap into the built-in Syndication feature for modules.  If you want the RSS feed for your module to work with the integrated syndication option then you have to implement ISearchable.  However there is a major problem in the implementation.  The links in the RSS can only get you back as far as the module itself.  If you look at the announcements module RSS output you will see what I mean.  The item links should get you to the articles, not just the list of articles.  I attempted to use this for syndication on a recent module and ran into this brick wall.  The solution is to write you own RSS output and forget about ISearchable for syndication.  Hopefully DNN will include a new interface specifically for the syndication feature in the future.  DNN team, if you are listening I would be happy to write this functionality if you will include it in the core!

My recommendation at this point is to forget about ISearchable completely.  For search and syndication it is very weak and simplistic.  My favorite alternative at this point is my own implementation of EasySearchASP into DNN.  On my new DNNSecrets site I am using the articles module from Scott McCulloch.  It happens to implement ISearchable.  I have added the EasySearchASP module to the search results page so you can compare the built in results with this much improved alternative.  Of course EasySearchASP is not free, but I think it is worth it to provide site users with a search that works!

I would love to hear your feedback!  What do you think of the ISearchable interface?  How do you like the EasySearchASP alternative?

10/27/2005 8:49:10 PM (Mountain Daylight Time, UTC-06:00)  #    Disclaimer  |  Comments [10]  |  Trackback
 Tuesday, October 25, 2005
I just got an Email about the new certification tracks.  For those of you who are MCSD you will have 2 new exams to get the premiere developer cert.  It looks like I would have to change jobs to get the Architecture cert.  Oh well, we will leave that one for Hanselman and Vasters.
10/25/2005 8:24:27 PM (Mountain Daylight Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, September 15, 2005
Today I discovered that Google finally launched a blog specific search engine.  Exactly 2 years ago I was at the PDC in Los Angeles with my buddy Richard Hundhausen at a small Google sponsored party.  Richard told them they needed a blog specific search engine.  It took them far too long, but I give credit to the idea to Richard!
9/15/2005 8:36:07 AM (Mountain Daylight Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, September 04, 2005

Occasionally I have posted things here that fit with reason #3 for naming this blog Option Strict. 

"#3 LIFE: Truth is not relative, optional, or determined by popular opinion."

Since most of my posts are technology related and I have a lot of things on my mind that pertain to much more important things in life I have started a new blog.  I am trying a new service from Yahoo as the host.  The blog is titled "You are the Church : Stop going, start being".  The posts will generally fit into exploring what it means to follow Jesus.

Here is the introduction post to the new blog.

Jesus is all I need

I have decided to start a new blog focused on Jesus.  I have had many thoughts and conversations lately that I want to share.  I hope that they encourage and even challenge you to find life in none but Him.  I look forward to having a ongoing dialog with those who find this blog and feel like joining in.
9/4/2005 2:10:05 PM (Mountain Daylight Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Tuesday, August 16, 2005

The August 1st, 2005 edition of InfoWorld has an interesting article about a new technology that looks like it will kill NAS (Network attached storage) as we know it today.  Currently NAS devices have drive controllers embedded in them and function like mini file servers on the network.  Zetera has created a solution that lets you put drives on the network that act like a SAN (Storage Attached Network).  The IP network becomes the pipeline directly to the disk.  This provides 2 awesome features.

#1 No controller needed in the drive enclosure significantly reducing cost and improving performance.
#2 The drives are seen to the local PC just like any physically attached hard disk, but without special, expensive hardware.

Additionally these drives can be mirrored and support other RAID configurations.

Netgear has a box coming any day that will host 2 IDE drives on the network using this technology.  It is slated at $129 retail and I can't wait to get one.  I look forward to seeing how it performs with applications an other things like that loaded onto it.  It may be the ideal data drive in the sky.  It would be interesting is the drive could be mounted before the OS loads, but I don't see how that would possible without a special NIC that could tell your BIOS it was a drive controller.  They are probably working on that if they don't have it already.

 

8/16/2005 8:35:45 AM (Mountain Daylight Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback