<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss version="2.0"><channel><title>Programmer Ramblings</title><link>http://programmerramblings.blogspot.com/</link><description>Ramblings on Sharepoint (WSS3.0), .NET Technologies (C#, ASP.NET, AJAX), SQL Server, etc.</description><language>en</language><managingEditor>noreply@blogger.com (Kenneth Scott)</managingEditor><lastBuildDate>Thu, 12 Nov 2009 06:30:45 PST</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">52</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ProgrammerRamblings" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>ASP.NET Session Timeout Control + jQuery Dialog + Countdown Timer</title><link>http://programmerramblings.blogspot.com/2009/08/aspnet-session-timeout-control-jquery.html</link><category>Javascript</category><category>.NET</category><category>ASP.NET</category><category>C#</category><category>jQuery</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Sun, 27 Sep 2009 20:22:28 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-7522736751493451044</guid><description>&lt;span style="color: rgb(255, 0, 0);"&gt;UPDATE:  9/27/2009 10:16PM&lt;/span&gt;&lt;br /&gt;I originally posted this control using the jCountr jquery plugin to handle the countdown timer for me.  Since then it has been brought to my attention that there were issues with this approach. Not to say the problems were from the jCountr plugin itself, but most likely my implementation of it.  Regardless, I have since abandoned the jCountr plugin approach and reverted to plain javascript for handling the countdown timer.  This seems to work better and give me more control over the process as well.  Both attached zip files have been updated accordingly.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;END UPDATE&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;This is my second iteration of what was originally Travis Collins' &lt;a href="http://weblogs.asp.net/traviscollins/archive/2008/02/22/ajax-timeout-server-control.aspx"&gt;ASP.NET Session Timeout Control&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Note:  You may want to read through my original &lt;a href="http://programmerramblings.blogspot.com/2009/03/aspnet-session-timeout-control-jquery.html"&gt;post&lt;/a&gt; about version1 of this control as I will only be covering changes here in this post.&lt;br /&gt;&lt;br /&gt;Essentially, v1 expanded upon Travis' original design and replaced a simple timeout warning div with a jQuery UI Dialog popup.&lt;br /&gt;&lt;br /&gt;Based upon feedback from several users (and my own continued use of the control), I now present to you v2 of this control.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://q5k4ua.bay.livefilestore.com/y1pq0SOrMDcxrZESMjpTRch4f42kgEbif09tmnNBwF6ZH_pWKU4A-_-Y3zFnewrRsSWM3OoJhbhaTPpZBjQ-Nggcx_mngf2AP6r/warning_dialog.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 387px; height: 280px;" src="http://q5k4ua.bay.livefilestore.com/y1pq0SOrMDcxrZESMjpTRch4f42kgEbif09tmnNBwF6ZH_pWKU4A-_-Y3zFnewrRsSWM3OoJhbhaTPpZBjQ-Nggcx_mngf2AP6r/warning_dialog.PNG" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The first and most notable change is a countdown timer.  If enabled, when  the warning popup appears -  it will countdown the time remaining until session timeout so that users can clearly see exactly how long they have left.  Of course the  timer calculates its countdown time based on the Timeout control's settings (which actually comes from the normal Session tag in your web.config).&lt;br /&gt;&lt;br /&gt;The countdown timer is implemented using a new property on the control called &lt;span style="font-weight: bold;"&gt;CountDownSpanID&lt;/span&gt;.  This controls the span element used to display the countdown timer.  *Note this setting is completely optional.&lt;br /&gt;&lt;br /&gt;The next change is the ability to control whether async/partial postbacks reset session.&lt;br /&gt;This is also implemented via a new property on the control - &lt;span style="font-weight: bold;"&gt;ResetSessionOnAsyncPostback&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;ResetSessionOnAsyncPostback is a boolean value that defaults to TRUE.  This means even if you don't set it - the control will work just as it did in version1.&lt;br /&gt;&lt;br /&gt;The last change is a very simple property called &lt;span style="font-weight: bold;"&gt;DirtyFormSpanID&lt;/span&gt;.  When set, the specified span will be given a value of "False" just prior to the timeout redirect.  I use this option in conjunction with other special purpose code  to implement dirty form warnings if a user attempts to leave a page with unsaved changes.  Please understand this control &lt;span style="font-weight: bold;"&gt;does not implement any type of dirty form warning&lt;/span&gt;.  &lt;span style="font-weight: bold;"&gt;ALL &lt;/span&gt;this option does is set a span  value to "False" upon timeout redirect.  Obviously,  this setting is completely optional.&lt;br /&gt;&lt;br /&gt;Here's an example of how to set all three of the new properties, as well as how to easily add the span for the countdown timer:&lt;br /&gt;&lt;pre class="html" name="code"&gt;&lt;br /&gt;&amp;lt;tsc:Timeout ID="Timeout1" runat="server" title="Session Expiring" Enabled="true" TimeoutURL="~/TimeOut.aspx" ResetSessionOnAsyncPostback="true" CountDownSpanID="tscCounter" DirtyFormSpanID="dirtyForm"&amp;gt;&lt;br /&gt;&amp;lt;Template&amp;gt;                     &lt;br /&gt;    &amp;lt;p&amp;gt;&lt;br /&gt;     &amp;lt;span class="ui-icon ui-icon-alert" style="float:left; margin: 1px 10px 20px 0;"&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;     Your session is about to Expire.&lt;br /&gt;    &amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;span id="tscCounter"&gt;&amp;lt;/span&gt;&lt;br /&gt;    &amp;lt;p&amp;gt;Click &amp;lt;b&amp;gt;OK&amp;lt;/b&amp;gt; to continue your session.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/Template&amp;gt;&lt;br /&gt;&amp;lt;/tsc:Timeout&amp;gt;&lt;br /&gt;&lt;/pre&gt;Just remember to add references to your script files (jquery, jqueryUI, bgiframe) and you should be good to go.&lt;br /&gt;&lt;br /&gt;Oh one more thing, if you're upgrading from the first version of my control, be aware I bumped the version number so you'll need to redo the reference to the dll.&lt;br /&gt;&lt;br /&gt;That's it.&lt;br /&gt;&lt;br /&gt;Full Timeout Control project (source, dll's, etc):&lt;br /&gt;&lt;iframe marginheight="0" marginwidth="0" style="border: 1px solid rgb(221, 229, 233); margin: 3px; padding: 0pt; width: 240px; height: 66px; background-color: rgb(255, 255, 255);" src="http://cid-f7c93b143c55f787.skydrive.live.com/embedrowdetail.aspx/ASPNET%7C_jQueryUI%7C_Dialog%7C_Timeout%7C_With%7C_Counter/TSC.Timeout%7C_With%7C_Counter.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Full working Web App solution demonstrating usage:&lt;br /&gt;&lt;iframe marginheight="0" marginwidth="0" style="border: 1px solid rgb(221, 229, 233); margin: 3px; padding: 0pt; width: 240px; height: 66px; background-color: rgb(255, 255, 255);" src="http://cid-f7c93b143c55f787.skydrive.live.com/embedrowdetail.aspx/ASPNET%7C_jQueryUI%7C_Dialog%7C_Timeout%7C_With%7C_Counter/ASPNET%7C_jQueryUI%7C_Dialog%7C_Timeout%7C_With%7C_Counter.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-7522736751493451044?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></item><item><title>ASP.NET Session Timeout Control + jQuery Dialog</title><link>http://programmerramblings.blogspot.com/2009/03/aspnet-session-timeout-control-jquery.html</link><category>Control</category><category>.NET</category><category>ASP.NET</category><category>jQuery</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Mon, 03 Aug 2009 22:14:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-1525718759088323764</guid><description>&lt;span style="color: rgb(255, 0, 0);"&gt;UPDATE!&lt;/span&gt;  8/4/2009 - click &lt;a href="http://programmerramblings.blogspot.com/2009/08/aspnet-session-timeout-control-jquery.html"&gt;HERE&lt;/a&gt; for new version of control (now with Countdown timer)&lt;br /&gt;&lt;br /&gt;For quite awhile now I've been a big fan of the &lt;a href="http://weblogs.asp.net/traviscollins/archive/2008/02/22/ajax-timeout-server-control.aspx"&gt;ASP.NET Session Timeout Control&lt;/a&gt; by Travis Collins.&lt;br /&gt;&lt;br /&gt;I really like the way he designed it - and by also implementing partial postback capability (see his post's comments) - it really takes care of everything I need in a timeout control... except for one thing.. visibility. That's the only complaint I've ever heard is that when the template div is made visible - it's not always the most eye-catching element.&lt;br /&gt;&lt;br /&gt;'Enter jQuery UI's Dialog (modal) &lt;a href="http://jqueryui.com/demos/dialog/#modal"&gt;plugin&lt;/a&gt;. I'd thought it'd be really nice to easily have a ui-themed dialog popup upon session timeout instead of simply showing a div. That'd definitely grab their attention instead of just a scrollTo + div.show() kind of approach.&lt;br /&gt;&lt;br /&gt;This is my (work-in-process) solution.&lt;br /&gt;&lt;br /&gt;We edit Travis's javascript file with the following changes:&lt;br /&gt;&lt;br /&gt;At the bottom of the &lt;span style="font-weight: bold;"&gt;initialize: function() {&lt;/span&gt;.... section, we add the following code (simply so we can override it if desired):&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;       this.initDialog();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That will allow the initialize routine to call our new initDialog function we're about to add (that we can easily override from the using application).&lt;br /&gt;&lt;br /&gt;So now we add our new initDialog function (I added mine just after the _resetTimeout function):&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;   // this will be the default Dialog if not overriden&lt;br /&gt;   initDialog: function(e) { &lt;br /&gt;       if (typeof jQuery.ui != 'undefined') {&lt;br /&gt;           var tsc = this;&lt;br /&gt;           $("#" + this._clientId).dialog({&lt;br /&gt;               autoOpen: false,&lt;br /&gt;               bgiframe: true,&lt;br /&gt;               modal: true,&lt;br /&gt;               buttons: {&lt;br /&gt;                   Ok: function() {&lt;br /&gt;                       $(this).dialog('close');&lt;br /&gt;                       CallServer();&lt;br /&gt;                       tsc._resetTimeout();&lt;br /&gt;                   }&lt;br /&gt;               }&lt;br /&gt;           });&lt;br /&gt;       }&lt;br /&gt;   },&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now Initialize will call this function and setup our default dialog if we don't bother to override it. (Notice we're not going to do anything if the jQuery.ui isn't loaded.)&lt;br /&gt;&lt;br /&gt;Next we change the existing showAboutToTimeout function to look like this:&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;   showAboutToTimeout: function(e) {&lt;br /&gt;       if (typeof jQuery.ui != 'undefined')&lt;br /&gt;           $("#" + this._clientId).dialog('open');&lt;br /&gt;       else {&lt;br /&gt;           $get(this._clientId).style.display = 'block';&lt;br /&gt;           ScrollToElement($get(this._clientId));&lt;br /&gt;       }&lt;br /&gt;       window.focus();&lt;br /&gt;   },&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So basically if jQuery.ui is loaded, we'll open our dialog (it should be initialized by now). If no jQuery.ui - we revert to Travis's original design.&lt;br /&gt;&lt;br /&gt;One more slight change to the _resetTimeout function and we're done:&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;       if (typeof jQuery.ui == 'undefined')&lt;br /&gt;           $get(this._clientId).style.display = 'none';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This just takes care of fully reverting to Travis's original design in case the jQuery UI isn't loaded. (Because our UI Dialog is going to close on it's own using the OK button function.&lt;br /&gt;&lt;br /&gt;So that's it! Now the timeout control is capable of detecting if you have the jQuery IU loaded - and if so - display a dialog upon timeout. If no UI detected - it reverts back to Travis's original show/hide div design.&lt;br /&gt;&lt;br /&gt;Here's an HTML example to use the new version of the Timeout control. Notice it still uses the original Template design for the dialog contents. *You have to add the &lt;span style="font-weight: bold;"&gt;title&lt;/span&gt; property to the Timeout control to set the Dialog window title:&lt;br /&gt;&lt;br /&gt;&lt;pre class="html" name="code"&gt;&lt;br /&gt;           &amp;lt;tsc:Timeout ID="Timeout1" runat="server" title="Session Expiring" Enabled="true" TimeoutURL="~/TimeOut.aspx" DisplayButton="false"&amp;gt;&lt;br /&gt;               &amp;lt;Template&amp;gt;                                    &lt;br /&gt;                   &amp;lt;p&amp;gt;&lt;br /&gt;                    &amp;lt;span class="ui-icon ui-icon-alert" style="float:left; margin: 1px 10px 20px 0;"&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;                    Your session is about to Expire.&lt;br /&gt;                   &amp;lt;/p&amp;gt;&lt;br /&gt;                   &amp;lt;br style="font-size:x-small;" /&amp;gt;&lt;br /&gt;                   &amp;lt;p&amp;gt;Click &amp;lt;b&amp;gt;OK&amp;lt;/b&amp;gt; to continue your session.&amp;lt;/p&amp;gt;               &lt;br /&gt;               &amp;lt;/Template&amp;gt;&lt;br /&gt;           &amp;lt;/tsc:Timeout&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;* Notice the dialog will be theme using whatever jQuery UI theme you are using.&lt;br /&gt;&lt;br /&gt;And lastly, an example of how you'd override the default Dialog from the using application's HTML (if you wanted to):&lt;br /&gt;&lt;pre class="html" name="code"&gt;&lt;br /&gt;   &amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;       TSC.Timeout.Timeout.prototype.initDialog() {&lt;br /&gt;           if (typeof jQuery.ui != 'undefined') {&lt;br /&gt;               var tsc = this;&lt;br /&gt;               $("#" + this._clientId).dialog({&lt;br /&gt;                   autoOpen: false,&lt;br /&gt;                   bgiframe: true,&lt;br /&gt;                   draggable: true,&lt;br /&gt;                   modal: true,&lt;br /&gt;                   buttons: {&lt;br /&gt;                       Ok: function() {&lt;br /&gt;                           $(this).dialog('close');&lt;br /&gt;                           CallServer();&lt;br /&gt;                           tsc._resetTimeout();&lt;br /&gt;                       }&lt;br /&gt;                   }&lt;br /&gt;               });&lt;br /&gt;           }&lt;br /&gt;       };&lt;br /&gt;   &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So there you have it - a fully jQuery UI Dialog enabled ASP.NET Session Timeout control! Thanks again to Travis Collins for his original design.&lt;br /&gt;&lt;br /&gt;Click below for full Timeout Control project (source, dll's, etc).&lt;br /&gt;&lt;iframe style="border: 1px solid rgb(221, 229, 233); margin: 3px; padding: 0px; width: 240px; height: 66px; background-color: rgb(255, 255, 255);" marginwidth="0" marginheight="0" src="http://cid-f7c93b143c55f787.skydrive.live.com/embedrowdetail.aspx/TSC%20Timeout%20Control/TSC.zip" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;NEW! Full working Web App solution demonstrating usage:&lt;br /&gt;&lt;iframe style="border: 1px solid rgb(221, 229, 233); margin: 3px; padding: 0px; width: 240px; height: 66px; background-color: rgb(255, 255, 255);" marginwidth="0" marginheight="0" src="http://cid-f7c93b143c55f787.skydrive.live.com/embedrowdetail.aspx/ASPNET%20jQueryUI%20Dialog%20Timeout/ASPNET%7C_jQueryUI%7C_Dialog%7C_Timeout.zip" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-1525718759088323764?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">39</thr:total></item><item><title>Async Error Handling Changes in .NET 3.5</title><link>http://programmerramblings.blogspot.com/2009/03/async-error-handling-changes-in-net-35.html</link><category>Javascript</category><category>.NET</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Fri, 06 Mar 2009 22:05:29 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-1584339858616616955</guid><description>I was recently surprised to learn about a very subtle, yet important change in asynchronous error handling that Microsoft implemented in ASP.NET AJAX 3.5.&lt;br /&gt;&lt;br /&gt;I'd noticed that async errors in a new 3.5 app I'm currently working on no longer resulted in the 2.0-style alert popup - but I just assumed it was some change in IE8RC1 causing the different behavior.  It finally bugged me enough that I spent a few minutes researching the topic and ran across a very interesting &lt;a href="http://weblogs.asp.net/davidbarkol/archive/2008/09/25/asynchronous-error-handling-change-in-asp-net-ajax-3-5.aspx"&gt;post&lt;/a&gt; on David Barkol's blog explaining the situation.&lt;br /&gt;&lt;br /&gt;It seems Microsoft decided to let us handle the error ourselves so we can do whatever we want with it (maybe use a cool jquery modal or something) instead of forcing us to use the vanilla alert box.&lt;br /&gt;&lt;br /&gt;David's blog also provides a great code example on how to catch the exception and reinstate the alert box behavior from .NET 2.0.&lt;br /&gt;&lt;br /&gt;Tip:  For a more descriptive error message, I will sometimes concatenate the usual e.Message text with the InnerException.Message text.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-1584339858616616955?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Sorting Textbox contents with jQuery TableSorter</title><link>http://programmerramblings.blogspot.com/2009/01/sorting-textbox-contents-with-jquery.html</link><category>Javascript</category><category>jQuery</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Fri, 06 Feb 2009 12:58:12 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-1316735480594422291</guid><description>&lt;p&gt;I recently needed to add client-side sorting to a table having one column of textboxes.  I wanted the client to have the same sorting capabilities for this column as they did for the rest of the columns in the table.&lt;/p&gt;  &lt;p&gt;Although I love the jQuery &lt;a href="http://tablesorter.com/"&gt;TableSorter&lt;/a&gt; plugin – the built-in parsers don’t really accommodate this type of thing.&lt;/p&gt;  &lt;p&gt;After a bit of javascript debugging, I realized as long as there wasn’t any other markup in the cell besides the textbox itself – it’d be pretty simple using a bit of &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; to extract the value.&lt;/p&gt;  &lt;p&gt;This is the custom parser I came up with:&lt;/p&gt;  &lt;pre class="javascript" name="code"&gt;$.tablesorter.addParser({&lt;br /&gt;   id: "textbox_text",&lt;br /&gt;   is: function(s) {&lt;br /&gt;       return false;&lt;br /&gt;   },&lt;br /&gt;   format: function(s) {&lt;br /&gt;       return $($.trim(s)).val().toLowerCase();&lt;br /&gt;   },&lt;br /&gt;   type: "text"&lt;br /&gt;});&lt;/pre&gt;The &lt;strong&gt;format&lt;/strong&gt; function takes the raw html of the &lt;strong&gt;input&lt;/strong&gt; element passed in via the &lt;strong&gt;s&lt;/strong&gt; argument and basically just uses jQuery to extract the &lt;strong&gt;val()&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Just remember the &lt;strong&gt;is&lt;/strong&gt; function always returns false so you have to explicitly set the parser on a particular column like this:&lt;pre class="javascript" name="code"&gt;$('#table1').tablesorter({&lt;br /&gt; headers: {&lt;br /&gt;     0: { sorter: "textbox_text" }&lt;br /&gt; }&lt;br /&gt;});&lt;/pre&gt;The cool thing is that although this illustrates the concept of extracting text from an input element, you could use this technique to obtain a value/attribute/childnode/etc from any type of element.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-1316735480594422291?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></item><item><title>Basic jQuery Examples for ASP.NET Controls</title><link>http://programmerramblings.blogspot.com/2008/11/basic-jquery-examples-for-aspnet.html</link><category>jQuery</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Wed, 22 Apr 2009 09:38:04 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-7450355004043354810</guid><description>&lt;p&gt;Well it’s official - I’m the newest member of the &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; fan club. Since Microsoft &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx"&gt;announced&lt;/a&gt; their partnership with the jQuery team and it’s integration with Visual Studio – I’ve been all over it.&lt;/p&gt;&lt;p&gt;I am amazed at how fast it’s taken off in the short time it’s been around. People are writing and publishing &lt;a href="http://plugins.jquery.com/"&gt;plugins&lt;/a&gt; like crazy.&lt;/p&gt;&lt;p&gt;As my first jQuery post, I thought I’d show a few basic examples of interacting with some of the common ASP.NET server controls.&lt;/p&gt;&lt;p&gt;DropDownList SelectedValue:&lt;/p&gt;&lt;pre class="csharpcode"&gt;GET:   $(&lt;span class="str"&gt;'#&amp;lt;%=DropDownList1.ClientID%&amp;gt;'&lt;/span&gt;).val()&lt;br /&gt;SET:   $(&lt;span class="str"&gt;'#&amp;lt;%=DropDownList1.ClientID%&amp;gt;'&lt;/span&gt;).val(&lt;span class="str"&gt;"value_to_set"&lt;/span&gt;)&lt;/pre&gt;&lt;p&gt;DropDownList SelectedIndex (2 options):&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;GET: $('#&amp;lt;%=DropDownList1.ClientID%&amp;gt;').attr("selectedIndex")&lt;br /&gt;GET: $('#&amp;lt;%=DropDownList1.ClientID%&amp;gt;')[0].selectedIndex &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;SET: $('#&amp;lt;%=DropDownList1.ClientID%&amp;gt;').attr("selectedIndex", "0")&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;SET: $('#&amp;lt;%=DropDownList1.ClientID%&amp;gt;')[0].selectedIndex = 0&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;RadioButtonList SelectedValue:&lt;/p&gt;&lt;pre class="csharpcode"&gt;GET:   $(&lt;span class="str"&gt;"input[name='&amp;lt;%=RadioButtonList1.UniqueID%&amp;gt;']:checked"&lt;/span&gt;).val()&lt;br /&gt;SET:   $("input[name='&amp;lt;%=RadioButtonList1.UniqueID%&amp;gt;'][value='value_to_set']").attr("checked", true)&lt;/pre&gt;&lt;p&gt;Button Enable/Disable&lt;/p&gt;&lt;pre class="csharpcode"&gt;$(&lt;span class="str"&gt;'#&amp;lt;%=Button1.ClientID%&amp;gt;'&lt;/span&gt;).attr(&lt;span class="str"&gt;"disabled"&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;/&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;&lt;p&gt;Label Text&lt;/p&gt;&lt;pre class="csharpcode"&gt;GET:  $(&lt;span class="str"&gt;'#&amp;lt;%=Label1.ClientID%&amp;gt;'&lt;/span&gt;).text()&lt;br /&gt;SET:  $(&lt;span class="str"&gt;'#&amp;lt;%=Label1.ClientID%&amp;gt;'&lt;/span&gt;).text(&lt;span class="str"&gt;"value_to_set"&lt;/span&gt;)&lt;/pre&gt;&lt;p&gt;TextBox Text (also HiddenField Value)&lt;br /&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;GET:  $(&lt;span class="str"&gt;'#&amp;lt;%=TextBox1.ClientID%&amp;gt;'&lt;/span&gt;).val()&lt;br /&gt;SET:  $(&lt;span class="str"&gt;'#&amp;lt;%=TextBox1.ClientID%&amp;gt;'&lt;/span&gt;).val(&lt;span class="str"&gt;"value_to_set"&lt;/span&gt;)&lt;/pre&gt;&lt;p&gt;Check Visibility&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; ($(&lt;span class="str"&gt;'#&amp;lt;%=Button1.ClientID%&amp;gt;'&lt;/span&gt;).&lt;span class="kwrd"&gt;is&lt;/span&gt;(&lt;span class="str"&gt;':visible'&lt;/span&gt;))&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;That’s it for now. More to come-&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-7450355004043354810?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></item><item><title>Visual Studio 2008 PowerCommands Add-In</title><link>http://programmerramblings.blogspot.com/2008/10/visual-studio-2008-powercommands-add-in.html</link><category>Visual Studio 2008</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Fri, 06 Mar 2009 22:15:38 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-3164360984807458121</guid><description>&lt;p&gt;UPDATE:  3/7/2009 - Make sure you follow the instructions in this forum &lt;a href="http://code.msdn.microsoft.com/PowerCommands/Thread/View.aspx?ThreadId=759"&gt;thread&lt;/a&gt; to prevent some very bizarre disappearing (AKA crashing) studio issues after installing this addin.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I’m not sure how I missed this great, free add-in for Visual Studio 2008 called &lt;a href="http://code.msdn.microsoft.com/PowerCommands"&gt;PowerCommands&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;It adds several handy features that I’ve grown quite fond of such as Collapse Projects, Open Containing Folder, Email CodeSnippet, etc.&lt;/p&gt;&lt;p&gt;‘Several truly useful functions.&lt;/p&gt;&lt;p&gt;See the &lt;a href="http://code.msdn.microsoft.com/PowerCommands"&gt;website&lt;/a&gt; for full details.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-3164360984807458121?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>SQL 2005 Management Studio Color Schemes</title><link>http://programmerramblings.blogspot.com/2008/09/sql-2005-management-studio-color.html</link><category>SQL 2005 Management Studio</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Mon, 08 Sep 2008 22:37:21 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-1027313130315334406</guid><description>If you're into &lt;a href="http://programmerramblings.blogspot.com/2008/02/visual-studio-2008-color-schemes-aka.html"&gt;Visual Studio Color Schemes&lt;/a&gt;, you'll want to check out Tomas Restrepo's &lt;a href="http://www.winterdom.com/weblog/CommentView,guid,506c6302-b9af-43fc-908e-728f309dcf96.aspx#commentstart"&gt;utility&lt;/a&gt; to port your current color scheme from Visual Studio into SQL Management Studio.  &lt;br /&gt;&lt;br /&gt;It basically just copies all the applicable registry settings from VS to SMS - but it turned out well for me.&lt;br /&gt;&lt;br /&gt;Check it out-&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-1027313130315334406?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Full (Bulk) Edit Dynamic ASP.NET ListView (AKA Spreadsheet in a Web Page)</title><link>http://programmerramblings.blogspot.com/2008/09/full-edit-dynamic-listview-aka.html</link><category>.NET</category><category>C#</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Fri, 15 May 2009 12:43:28 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-3741630842128872937</guid><description>&lt;p&gt;Inspired from &lt;a href="http://www.mattberseth.com/"&gt;Matt Berseth's&lt;/a&gt; awesome &lt;a href="http://mattberseth.com/blog/2008/05/bulk_inserting_data_with_the_l.html"&gt;Bulk Insert ListView&lt;/a&gt;, I present a slightly modified version that is in essence an auto-saving, dynamic row, viewstate-based listview.&lt;/p&gt;&lt;p&gt;&lt;img src="http://exsgqg.bay.livefilestore.com/y1pPUHrweqv-ZeihjD4JK15nJYvUrSv86f-lzmJbp-yI1TE0Y0zyjmU1Fezmoz512MZdjuSqusvxcU/viewstatelistview.JPG" /&gt;&lt;br /&gt;It functions basically just like a blank spreadsheet. You start out with one blank row. Need more rows? Click Add. Add too many? Click Delete.&lt;br /&gt;&lt;br /&gt;The nice thing is that anytime you click anything, the contents are saved to viewstate via an ObjectDataSource.&lt;br /&gt;&lt;br /&gt;After you've entered everything you need, click Submit and do whatever you need to do with the data (send it to a database, etc).&lt;br /&gt;&lt;br /&gt;The ListView's ItemTemplate is made up of input controls (TextBoxes, DropDownLists, etc) - so it's basically always in edit mode.. there's just no Edit/Update/Cancel clicking required.&lt;br /&gt;&lt;br /&gt;I also demonstrate the use of special-case bindings like the DropDownList that you can't simply %# Bind % like normal TextBoxes.&lt;br /&gt;&lt;br /&gt;Saving state is accomplished somewhat similar to Matt's, only mine saves via an overriden OnItemCommand event in an extended ListView class. This makes saving state *almost* completely automatic.&lt;br /&gt;&lt;br /&gt;The elegance is in the simplicity. There's nothing quirky or magic about it. It's just a combination of simple concepts that result in an intuitive bulk input grid.  And obviously you could also use it to Edit existing data in a dynamic way - just load the ListView on Page_Load.&lt;br /&gt;&lt;br /&gt;Again, a huge thanks to &lt;a href="http://www.mattberseth.com/"&gt;Matt Berseth&lt;/a&gt; for the original concept/stylings/etc.&lt;br /&gt;&lt;br /&gt;Full source is available below:&lt;br /&gt;&lt;iframe style="BORDER-RIGHT: rgb(221,229,233) 1px solid; PADDING-RIGHT: 0pt; BORDER-TOP: rgb(221,229,233) 1px solid; PADDING-LEFT: 0pt; PADDING-BOTTOM: 0pt; MARGIN: 3px; BORDER-LEFT: rgb(221,229,233) 1px solid; WIDTH: 240px; PADDING-TOP: 0pt; BORDER-BOTTOM: rgb(221,229,233) 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: rgb(255,255,255)" marginwidth="0" marginheight="0" src="http://cid-f7c93b143c55f787.skydrive.live.com/embedrowdetail.aspx/ViewStateListView/ViewStateListView.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-3741630842128872937?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>ASP.NET Site Warmup</title><link>http://programmerramblings.blogspot.com/2008/09/aspnet-site-warmup.html</link><category>.NET</category><category>IIS</category><category>C#</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Tue, 24 Mar 2009 21:32:54 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-5229291338690876320</guid><description>ASP.NET applications by nature exhibit some degree of delay upon initial access to the site.  This is due to the nature of the JIT compilation, caching, etc - and most all ASP.NET websites of any size are going to exhibit some amount of delay on that first hit.&lt;br /&gt;&lt;br /&gt;Now if you've ever done any admin work with Sharepoint, you've most likely used the Sharepoint-specific &lt;a href="http://blogs.msdn.com/joelo/archive/2006/08/13/697044.aspx"&gt;warmup script&lt;/a&gt; to eliminate Sharepoint's extremely annoying first-hit delay.&lt;br /&gt;&lt;br /&gt;It was actually that script that got me thinking..  why not write a little app I can schedule to programmatically perform that first hit to any site(s) I want?&lt;br /&gt;&lt;br /&gt;Sure, you could just plug an individual URL into a Scheduled Task and get the same effect - but this way just seemed a little cleaner to me.&lt;br /&gt;&lt;br /&gt;Now there is nothing magic about the app.  All it does is read in a list of sites from an xml file and perform an HTTP GET against them using an HttpWebRequest.  The only thing even remotely out of the ordinary is that I included code to use the DefaultCredentials and also set the UserAgent.  &lt;br /&gt;&lt;br /&gt;I actually didn't realize it before this, but if you don't set the UserAgent and attempt to do a GET to a page that contains an AJAX .NET UpdatePanel - the page doesn't recognize the UserAgent and you'll get the wonderfully generic 500 System Error.&lt;br /&gt;&lt;br /&gt;The heart of the code is this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="c-sharp" name="code"&gt;&lt;br /&gt;foreach (XmlNode node in xmlDoc.SelectNodes("Sites/Site"))&lt;br /&gt;{&lt;br /&gt; XmlElement url = (XmlElement)node;&lt;br /&gt; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url.SelectSingleNode("URL").InnerText);&lt;br /&gt; request.Credentials = CredentialCache.DefaultCredentials;&lt;br /&gt; request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)";&lt;br /&gt; WebResponse response = request.GetResponse();&lt;br /&gt; response.Close();&lt;br /&gt; Console.WriteLine(String.Format("{0} : Successful", url.SelectSingleNode("URL").InnerText));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To use, simply plug your sites into the sites.xml file and schedule the app to run as a Scheduled Task.&lt;br /&gt;&lt;br /&gt;You may also run the exe with any normal help trigger (/h or /? or -? or etc..) for more information.&lt;br /&gt;&lt;br /&gt;Download the full source below:&lt;br /&gt;&lt;iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-f7c93b143c55f787.skydrive.live.com/embedrowdetail.aspx/ASPNET%20Site%20Warmup/ASPNET%7C_SiteWarmup.zip"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-5229291338690876320?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Elegant Date Validation in C#</title><link>http://programmerramblings.blogspot.com/2008/08/elegant-date-validation-in-c.html</link><category>C#</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Mon, 11 Aug 2008 21:14:05 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-4851775524600001249</guid><description>Simple example of a clean, elegant way to validate a date of any format without throwing a single exception.&lt;br /&gt;&lt;br /&gt;&lt;pre class="c-sharp" name="code"&gt;&lt;br /&gt;System.IFormatProvider format = new System.Globalization.CultureInfo("en-US", true);&lt;br /&gt;&lt;br /&gt;DateTime outDate;&lt;br /&gt;&lt;br /&gt;bool isDate = DateTime.TryParseExact("08112008", "MMddyyyy", format, &lt;br /&gt;  System.Globalization.DateTimeStyles.AllowWhiteSpaces, out outDate);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The TryParseExact method allows you specify the exact formatting of the input string.  If the Parse is successful, the boolean returned will be True - and the output DateTime variable will contain a valid date.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-4851775524600001249?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>LCSMessengerHistory Helper App</title><link>http://programmerramblings.blogspot.com/2008/07/lcsmessengerhistory-helper-app.html</link><category>Messenger</category><category>Applications</category><category>Communicator</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Fri, 25 Jul 2008 19:06:23 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-1404432766131991405</guid><description>If you're unlucky enough to still be running MS Office Communicator 2005, you know the pain of not having any kind of automatic conversation logging ability.  Sure, you have the manual option of saving an individual conversation to an RTF file or emailing it to yourself, but who wants to remember to do that every time? &lt;br /&gt;&lt;br /&gt;Luckily there's a free open-source helper app from Darrin M. Gorski called &lt;a href="http://www.gorski.net/darrin/lcsmh/"&gt;LCSMessengerHistory&lt;/a&gt; that fills this void.  The great part is that even if you don't think it works exactly like it should - just grab the source and tailor it to your liking.&lt;br /&gt;&lt;br /&gt;While it's not exactly "integrated" with Communicator - meaning it basically just runs along-side Communicator - it still works great.&lt;br /&gt;&lt;br /&gt;Couple this with Windows Desktop Search 4.0 to index all those saved conversations and you'll have instant searchable access to all your past conversations.&lt;br /&gt;&lt;br /&gt;* It should be noted that MS Office Communicator 2007 has a built-in Conversation History logging feature that creates a folder within Outlook and stores your conversations there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-1404432766131991405?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>DebugBar &amp; IETester</title><link>http://programmerramblings.blogspot.com/2008/07/debugbar-ietester.html</link><category>Applications</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Wed, 02 Jul 2008 22:26:05 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-5484491831234582701</guid><description>Just a quick reference to a couple of really cool utilities I ran across earlier - &lt;a href="http://www.my-debugbar.com/wiki/IETester/HomePage"&gt;IETester&lt;/a&gt; and &lt;a href="http://www.debugbar.com/"&gt;DebugBar&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;They're both available on the DebugBar &lt;a href="http://www.debugbar.com/"&gt;homepage&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;IETester is an incredibly handy little tool to test your app in multiple versions of IE at the same time.  It features a tabbed interface and you simply pick the version of IE you want when you add a new tab.  With Microsoft making it (nearly) impossible to run multiple versions of IE at the same time, this FREE app fills a huge void.&lt;br /&gt;&lt;br /&gt;DebugBar is also an extremely handy debugger's toolbar (think Firebug for Firefox).  It's FREE as well, but unfortunately only for personal use.&lt;br /&gt;&lt;br /&gt;I still haven't used DebugBar enough to give it a fair comparison against the standard &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;amp;displaylang=en"&gt;Microsoft IE Developer Toolbar&lt;/a&gt; - but I really like what I see.  It seems to have quite a bit more functionality than MS's version.&lt;br /&gt;&lt;br /&gt;With them all being free, how can you go wrong?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-5484491831234582701?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Color Coded Calendar for Sharepoint</title><link>http://programmerramblings.blogspot.com/2008/04/color-coded-calendar-for-sharepoint.html</link><category>WebPart</category><category>WSS3.0</category><category>Sharepoint</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Thu, 24 Apr 2008 21:29:23 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-2264919539145003171</guid><description>If you've ever spent time screwing around with javascript and custom columns trying to get color coding functionality out of a Sharepoint calendar, you will LOVE &lt;a href="http://planetwilson.blogspot.com"&gt;Mark Wilson's&lt;/a&gt; &lt;a href="http://www.codeplex.com/planetwilson"&gt;Colour Calendar v2.3&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It's a nicely packaged solution that works on both WSS3.0 and MOSS2007 and seems to work quite well.  I've been playing around with it on a test server for a couple of days now and I'm really impressed with how easily it just works.  You basically deploy the feature on the site, Activate it, and enable it on whatever Calendar you want - and it takes it from there.  It creates custom lists and content types and ties everything together so you basically don't have to do anything manually if you don't want to.  After activation, adding new calendar entries will give you a new dropdown/choice field for Event Category that controls what color is shown.  There are several defaults included, or you can modify/create your own.  &lt;br /&gt;&lt;br /&gt;I do have one question I need to ask Mark though about using custom color lists instead of inheriting the defaults from the root site.  Most of our sites are full Site Collections off the root/sites/.. setup - and whenever I Activate the feature on a Site Collection, it sets everything up and works just fine..  but it strangly creates a Color Mapping List that it simply doesn't use.  By default it's pointed back to the root site's List - and I've tried changing the one at the Site Collection level and then pointing it to this modified List - but it doesn't seem to like it...  but you can create a brand new Color Mapping List in your Site Collection - and it seems to take that one just fine.&lt;br /&gt;&lt;br /&gt;So anyway, I'm sure there's some method to the madness.  I probably just haven't spent enough time with it to get my head around it.  &lt;br /&gt;&lt;br /&gt;It could probably use a little more detail in the documentation concerning setting up/modifying these Custom Color Mapping Lists - but aside from that, the thing still works beautifully.  Especially if you don't want custom colors - then it's a total no-brainer.  I'm sure my situation is simply "Operator Error".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-2264919539145003171?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>LINQ to XML</title><link>http://programmerramblings.blogspot.com/2008/04/linq-to-xml.html</link><category>XML</category><category>LINQ</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Thu, 24 Apr 2008 21:11:07 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-4463257231441529958</guid><description>I had the opportunity to play around with LINQ to XML today for a real-world project.  &lt;br /&gt;&lt;br /&gt;I have to admit I am LOVING how easy it is to whip out an XDocument with some XElements in only a couple of lines of code.  &lt;br /&gt;&lt;br /&gt;&lt;pre class="c-sharp" name="code"&gt;&lt;br /&gt;var xmlData = new XElement("Transactions", &lt;br /&gt;              from trans in dc.Transactions&lt;br /&gt;                select new XElement("Transaction",&lt;br /&gt;                  new XElement("Date", trans.Date),&lt;br /&gt;                  new XElement("Amt", trans.Amt)));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's pretty flexible in that if you dont want the generic var, you could actually create a strongly typed XElement instead.&lt;br /&gt;&lt;br /&gt;This makes it a snap to do things like create a single XDocument - and then piece together the document from different data sources or database servers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-4463257231441529958?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>LINQ Grouping Example</title><link>http://programmerramblings.blogspot.com/2008/04/linq-grouping-example.html</link><category>LINQ</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Tue, 08 Apr 2008 21:32:27 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-4381134546258009573</guid><description>I recently had the need to do some grouping on a SQL db table via LINQ. Records were grouped based on a single identifier field - but then to make them unique they had a version field that started at 0 and incremented whenever the record was modified (each modification created a new copy of the record with the incremented version#). So of course I needed to only pull the most recent versions of these records.&lt;br /&gt;&lt;br /&gt;Example Records:&lt;br /&gt;&lt;br /&gt;Identifier Version Data&lt;br /&gt;1234ABC 000 ................ &lt;- dont select this one&lt;br /&gt;12BCD34 000 ................ &lt;- select this one&lt;br /&gt;1234ABC 001 ................ &lt;- select this one&lt;br /&gt;etc..&lt;br /&gt;&lt;br /&gt;I've done this type of thing before with raw sql, but this was my first attempt at it via LINQ.&lt;br /&gt;&lt;br /&gt;&lt;pre class="c-sharp" name="code"&gt;&lt;br /&gt;var recs = from trans in dc.Transactions&lt;br /&gt;           group trans by new &lt;br /&gt;           { &lt;br /&gt;              Identifier = trans.Identifier&lt;br /&gt;           } into grp&lt;br /&gt;           select new &lt;br /&gt;           { &lt;br /&gt;              Identifier = grp.Key.Identifier,&lt;br /&gt;              Version = grp.Max(t =&gt; t.Version)&lt;br /&gt;           };&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Pretty simple once you get your head around the syntax. It simply groups on the Identifier column and only selects the Version with the highest number.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-4381134546258009573?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>ClipX Clipboard Manager</title><link>http://programmerramblings.blogspot.com/2008/04/clipx-clipboard-manager.html</link><category>Applications</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Tue, 01 Apr 2008 20:50:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-423539901074408528</guid><description>For years I've tried (and abandoned) several different clipboard manager apps.  They all sound great in theory, but in practice - it's a different story. &lt;br /&gt;&lt;br /&gt;Enter &lt;a href="http://bluemars.org/clipx"&gt;ClipX &lt;/a&gt;from Francis Gastellu.  ClipX has totally changed the way I think about clipboard management.  I've been using the latest beta (1.0.3.9c) - and have been very impressed with what I've seen.  Not only is this thing extremely lean and quick (generally uses only about 600kb of RAM) - it's completely extendable with it's own SDK.  A few truly useful plugins are also available for instant extension.&lt;br /&gt;&lt;br /&gt;I have to admit, I didn't care much for the default hotkey configuration - but it's completely customizable so without much trouble I had it working just like I wanted.&lt;br /&gt;&lt;br /&gt;Some of the best features include the ability to save clips between sessions (or permanently), view copied images while in the clipboard, etc.  I especially love the Smart Navigation plugin that you can setup with regular expressions to launch apps when certain regex patterns are matched.  It even includes a couple of builtin regex patterns to get you started (URL Extractor, Mailto, etc).  You simply copy a url (or string of text that contains a URL or maybe an email address) - and hit your designated HotKey - and poof - the app you have setup with launch and navigate to the url, setup the email, etc.&lt;br /&gt;&lt;br /&gt;* Note:  There are actually options within the base app itself to perform browser navigation and launch application functionality - but they are disabled in the current beta.  I emailed the author and he promises to have them functional by the next release.&lt;br /&gt;&lt;br /&gt;Oh, did I mention it's FREE?&lt;br /&gt;&lt;br /&gt;This will definitely go on my &lt;a href="http://programmerramblings.blogspot.com/2007/10/my-favorite-mostly-free-applications.html"&gt;Favorite Freebies&lt;/a&gt; list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-423539901074408528?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>STSADM Extensions from Gary Lapointe</title><link>http://programmerramblings.blogspot.com/2008/03/stsadm-extensions-from-gary-lapointe.html</link><category>WSS3.0</category><category>Sharepoint</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Mon, 31 Mar 2008 20:44:18 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-216044100563480402</guid><description>I just wanted to reference an incredibly handy STSADM Extension that you simply install like a Feature.&lt;br /&gt;&lt;br /&gt;It adds dozens of handy options to the Sharepoint command-line utility STSADM.EXE.&lt;br /&gt;&lt;br /&gt;The Extensions are courtesy of Gary Lapointe and you can find it on his blog &lt;a href="http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It seems to work fine in WSS3.0 (as well as MOSS2007).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-216044100563480402?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Adventures with WSS3.0 Room and Equipment Reservation Application Template</title><link>http://programmerramblings.blogspot.com/2008/03/adventures-with-wss30-room-and.html</link><category>WSS3.0</category><category>Sharepoint</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Tue, 08 Apr 2008 15:50:09 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-8635548846035266490</guid><description>&lt;strong&gt;UPDATE 4/7/2008 - 11:06PM:&lt;/strong&gt;&lt;br /&gt;I spent a few more hours digging through the template and doing some testing. In the end, I simply cannot recommend the RER template for critical production use. Specifically, the email Alerts just don't work consistently. *I also could never figure out how to keep the Status field from being displayed in the email Alert body text (without making more changes than it was worth anyway).&lt;br /&gt;&lt;br /&gt;But the use of Alerts was a core requirement for my needs - and without that... well, it's pretty much useless to me.&lt;br /&gt;&lt;br /&gt;I probably created 50 sites during testing, and I simply never got the same results with Alerts. Sometimes email Alerts would only trigger on the real "&lt;strong&gt;Requested&lt;/strong&gt;" status'es - while other times they'd be triggered by the "&lt;strong&gt;Available&lt;/strong&gt;" status'es... and *sigh* - sometimes they simply wouldn't be triggered at all.&lt;br /&gt;&lt;br /&gt;I do know there are a lot of people complaining about Alerts in general. Specifically, how reliable they are and to what extent they should be counted on. But I've never had much of a problem with them on the servers in question. They're anything but 100% - but still - they've always been pretty consistent for me. Sadly, such was simply not the case with my adventures with the RER template.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ORIGINAL POST:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;After I installed Sharepoint’s RER app template, I quickly realized just how limited its use was.&lt;br /&gt;Upon installation, I quickly realized that by default – you can NOT SEE other people’s reservations?!? What the heck is up with that?&lt;br /&gt;&lt;br /&gt;For working with the actual reservations, you get 2 pages: “&lt;strong&gt;Reserve a Resource&lt;/strong&gt;” and “&lt;strong&gt;My Reservations&lt;/strong&gt;”. Reserve a Resource allows you to see (ONE-DAY-AT-A-TIME) other people’s reservations – but you can NOT tell anything about the reservation itself (i.e. who made it). And of course on the My Reservations page – you guessed it – you only get your own reservations listed. They actually give you a third page that they don’t bother including a link to – you just kind of have to stumble upon it – “&lt;strong&gt;Reservations Calendar&lt;/strong&gt;” – by changing the view on the “&lt;strong&gt;My Reservations&lt;/strong&gt;” page. But guess what? IT ONLY SHOWS YOUR OWN RESERVATIONS TOO – just in a calendar view. Why so secretive Microsoft?!? Well, actually there is one view that shows everything – “&lt;strong&gt;Allitems&lt;/strong&gt;” view – but it’s a LIST view… come on Microsoft…&lt;br /&gt;&lt;br /&gt;So it’s about this time that you start going – well surely I can just change those view filters and do what I want. HAH! So so wrong.. You see, to make this Reservation process work in a way that doesn’t allow overlapping reservations – Microsoft devised a method consisting of a hidden Status field called “&lt;strong&gt;RERStatus&lt;/strong&gt;”. It is a choice field with values of &lt;strong&gt;Available&lt;/strong&gt; and &lt;strong&gt;Requested&lt;/strong&gt; (there’s also &lt;strong&gt;Approved&lt;/strong&gt; I believe, but I’ve never seen it used). Now like I said, this field is completely hidden by definition and you cannot get your hands on it. Which is actually a good thing by default because you can totally hose the reservations by screwing around with it (and make your resources appear booked forever).&lt;br /&gt;&lt;br /&gt;The methodology is nothing magic.. they simply use the status to indicate when you can make the reservation. For a day with let’s say a 9:00AM-11:00AM reservation, the list table will have entries like the following:&lt;br /&gt;&lt;br /&gt;Conf Room 1 12:00AM 9:00AM Available&lt;br /&gt;Conf Room 1 9:00AM 11:00AM Requested&lt;br /&gt;Conf Room 1 11:00AM Available&lt;br /&gt;&lt;br /&gt;If you pop open the &lt;strong&gt;RoomEquipmentReservations.wsp&lt;/strong&gt; (aka .cab file) – you can open the &lt;strong&gt;ReservationEventHandler.dll&lt;/strong&gt; with Reflector and see the code used to check the Status and Date Range and either make the reservation or error out with the appropriate message.&lt;br /&gt;&lt;br /&gt;Now moving on… If you do get all brave and decide you want the ability to create/manipulate your own views and do whatever you want with this magic “&lt;strong&gt;Status&lt;/strong&gt;” field – you’ll want to modify the List Field attributes in the schema file.&lt;br /&gt;&lt;br /&gt;If you’ve already installed the template – you’ll find the schema.xml file here:&lt;br /&gt;&lt;strong&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ReservationsList\Reservation\schema.xml&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you haven’t installed it – you can crack open the &lt;strong&gt;ApplicationTemplateCore.wsp&lt;/strong&gt; (aka .cab file) – and edit this guy:&lt;br /&gt;&lt;strong&gt;ReservationsList\Reservation\schema.xml&lt;/strong&gt; (just make a backup first)&lt;br /&gt;&lt;br /&gt;The part you’re looking for is:&lt;br /&gt;&amp;lt;Field ID="{6f99f38c-e91f-46be-a4f8-255f793967c9}" Name="&lt;strong&gt;RERStatus&lt;/strong&gt;" Group="RER Columns" Type="Choice" DisplayName="$Resources:rer,RERStatus_DispName;" Hidden="&lt;span style="color:#ff0000;"&gt;TRUE&lt;/span&gt;"&amp;gt;&lt;br /&gt;&lt;br /&gt;CHANGE TO:&lt;br /&gt;&amp;lt;Field ID="{6f99f38c-e91f-46be-a4f8-255f793967c9}" Name="&lt;strong&gt;RERStatus&lt;/strong&gt;" Group="RER Columns" Type="Choice" DisplayName="$Resources:rer,RERStatus_DispName;" &lt;span style="color:#ff0000;"&gt;ShowInNewForm="FALSE" ShowInEditForm="FALSE" ShowInDisplayForm="FALSE"&lt;/span&gt; Hidden="&lt;span style="color:#ff0000;"&gt;FALSE&lt;/span&gt;"&amp;gt;&lt;br /&gt;&lt;br /&gt;Notice I added the attributes &lt;strong&gt;ShowInNew/Edit/ViewForm&lt;/strong&gt; because if you don’t – after you set that &lt;strong&gt;Hidden=TRUE&lt;/strong&gt; property - the field will be visible and changeable everywhere (which would be really, really bad).&lt;br /&gt;&lt;br /&gt;*Note1: I couldn’t figure out how to keep the Status field from displaying in email &lt;strong&gt;Alert&lt;/strong&gt; body’s.&lt;br /&gt;**Note2: If you edited the installed &lt;strong&gt;schema.xml&lt;/strong&gt; – you’ll have to restart IIS to pickup your change.&lt;br /&gt;&lt;br /&gt;Anyway, you now have a site with the magic &lt;strong&gt;Status&lt;/strong&gt; field visible in the right places so you can use it however you like.&lt;br /&gt;&lt;br /&gt;You should now be able to edit any of the existing Views and see the real Filter parameters and how they’re using “&lt;strong&gt;NOT EQ Status=Available&lt;/strong&gt;” everywhere to keep out the placeholder records... So you can now create your own views or modify the existing ones to your liking.&lt;br /&gt;&lt;br /&gt;BUT BE WARNED, if your permissions allow your members to CREATE VIEWS (which they do by default) – I HIGHLY SUGGEST you remove those permissions, else users could possibly create their own views and NOT take into account the Status field (thereby pulling records they shouldn’t). Because once those placeholder (Status=Available) records are visible – people will see them and get confused/delete them and trash the site/etc.&lt;br /&gt;&lt;br /&gt;You can set these permissions here:&lt;br /&gt;&lt;strong&gt;People and Groups - Site Permissions - Settings/Permission Levels.&lt;br /&gt;&lt;/strong&gt;You'll normally modify &lt;strong&gt;Contribute&lt;/strong&gt; access (because that's what &lt;strong&gt;Members&lt;/strong&gt; have by default - and &lt;strong&gt;Members&lt;/strong&gt; are probably the ones you have designated as having the ability to make reservations).&lt;br /&gt;* Note: You will have to disable inheriting permissions from parent site to make this change:&lt;br /&gt;&lt;br /&gt;So after clicking &lt;strong&gt;Contribute&lt;/strong&gt; - scroll down to &lt;strong&gt;Personal Permissions&lt;/strong&gt; and MAKE SURE "&lt;strong&gt;Manage Personal Views - Create, change, and delete personal views of lists.&lt;/strong&gt;" is UNCHECKED.&lt;br /&gt;&lt;br /&gt;*Another tip – if you’ll notice, the “&lt;strong&gt;Reservations Calendar&lt;/strong&gt;” view doesn’t have the &lt;strong&gt;toolbar&lt;/strong&gt; on by default. If you try and edit the Web Part to put it back – you’ll get some screwy results (mine would often disappear entirely). The alternative is to set it at the source (back in the same schema.xml file as the List Field definitions):&lt;br /&gt;&lt;br /&gt;To set it, find this:&lt;br /&gt;&amp;lt;View BaseViewID="3" Type="&lt;strong&gt;CALENDAR&lt;/strong&gt;" WebPartZoneID="Main" DisplayName="$Resources:rer,ReservationsCalendar_ViewName;" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/announce.png" Url="ReservationCalendar.aspx" Scope="Recursive"&amp;gt;&lt;br /&gt;&amp;lt;Toolbar Type="&lt;span style="color:#ff0000;"&gt;None&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&lt;br /&gt;And change it to “&lt;strong&gt;Standard&lt;/strong&gt;” for the full normal toolbar:&lt;br /&gt;&amp;lt;View BaseViewID="3" Type="&lt;strong&gt;CALENDAR&lt;/strong&gt;" WebPartZoneID="Main" DisplayName="$Resources:rer,ReservationsCalendar_ViewName;" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/announce.png" Url="ReservationCalendar.aspx" Scope="Recursive"&amp;gt;&lt;br /&gt;&amp;lt;Toolbar Type="&lt;span style="color:#ff0000;"&gt;Standard&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&lt;br /&gt;*** Notes about RER and Email Alerts:&lt;br /&gt;&lt;br /&gt;My new custom views consist basically of clones of the originals – only filtered to show a single resource. For example, I created individual Calendar Views for each individual Resource. This just makes it a little nicer for users wanting a calendar view to only have to look through entries for the particular resource they’re interested in. I also took the opportunity on these custom Calendar views to change it so that the Reserved By field is displayed on the calendar date instead of the Resource name.&lt;br /&gt;&lt;br /&gt;Everything was rolling along fine until I realized you can’t create alerts from Calendar views. So I thought – OK – I’ll just create List views for each calendar.. basically the same filter and everything – just a List instead of a Calendar. You can then select THOSE List views in the Alert setup.. but for some reason I cannot get these to work. The existing default views (MyReservations and Allitems) trigger Alerts perfectly – but I cannot seem to get my custom List views to trigger them. I see them setup in the &lt;strong&gt;ImmedSchedule&lt;/strong&gt; table in the &lt;strong&gt;WSS_Content&lt;/strong&gt; database – but they don’t seem to be triggered for some reason.&lt;br /&gt;&lt;br /&gt;I hope to have a resolution soon and I will update my findings.&lt;br /&gt;&lt;br /&gt;If you have any ideas, I’d love to hear them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-8635548846035266490?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">15</thr:total></item><item><title>Add Messenger Presence to Web Pages</title><link>http://programmerramblings.blogspot.com/2008/03/add-messenger-presence-to-web-pages.html</link><category>Messenger</category><category>Javascript</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Wed, 26 Mar 2008 18:05:17 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-6281263113913483248</guid><description>Did you know it's extremely easy to add Messenger presence to web pages?&lt;br /&gt;&lt;br /&gt;I recently ran across the ActiveX control "Name.NameCtrl" that you can call via client-side script and display the Messenger status icon (which also provides calendar availability, link to email, link to instant message, etc).&lt;br /&gt;&lt;br /&gt;The control has two main methods - ShowOOUI() and HideOOUI().&lt;br /&gt;&lt;br /&gt;The concept is simple:&lt;br /&gt;1) instantiate the control on page load&lt;br /&gt;2) add callable functions to Show/Hide the presence info&lt;br /&gt;3) use an event such as onmouseover/onmouseout to call the functions&lt;br /&gt;&lt;br /&gt;If you're using Microsoft's AJAX .net framework, they make it really easy providing the perfect place to instantiate the object (the built-in pageLoad() event) - and there's even a Sys.UI method for getting the X and Y coordinates of an element.&lt;br /&gt;&lt;br /&gt;If you're not using the framework, you can still do it the old fashioned way.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;  // create Messenger activexobj (using pageLoad(), body onLoad, etc)&lt;br /&gt;  NameObj = new ActiveXObject("Name.NameCtrl");&lt;br /&gt;&lt;br /&gt;  // show Messenger icons&lt;br /&gt;  function ShowOOUI(name, element)&lt;br /&gt;  {&lt;br /&gt;     var offsetX = 0;&lt;br /&gt;     var offsetY = 0;&lt;br /&gt;     var parent;&lt;br /&gt;     // this X/Y coordinate code was taken from the AJAX .NET framework&lt;br /&gt;     for (parent = element; parent; parent = parent.offsetParent) {&lt;br /&gt;       if (parent.offsetLeft) {&lt;br /&gt;         offsetX += parent.offsetLeft;&lt;br /&gt;       }&lt;br /&gt;       if (parent.offsetTop) {&lt;br /&gt;         offsetY += parent.offsetTop;&lt;br /&gt;       }&lt;br /&gt;     }&lt;br /&gt;     NameObj.ShowOOUI(name, 1, offsetX, offsetY);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // hide Messenger icons&lt;br /&gt;  function HideOOUI()&lt;br /&gt;  {&lt;br /&gt;     NameObj.HideOOUI();&lt;br /&gt;  }&lt;/pre&gt;&lt;br /&gt;Then just call it from an element's onmouseover/onmouseout events like:&lt;br /&gt;onmouseover="ShowOOUI('somebody@nowhere.com', this);"&lt;br /&gt;onmouseout="HideOOUI();"&lt;br /&gt;&lt;br /&gt;FYI - My usage has been in an intranet environment using Windows Messenger 5.1 (SIP/Live Comm Server backend). It's also my understanding that Office is what actually installs the prerequisite DLLs.&lt;br /&gt;&lt;br /&gt;Additional info &lt;a href="http://msdn2.microsoft.com/en-us/library/bb862236.aspx"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-6281263113913483248?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>Convert Hex String to Byte Array and Vice-Versa</title><link>http://programmerramblings.blogspot.com/2008/03/convert-hex-string-to-byte-array-and.html</link><category>.NET</category><category>C#</category><category>Code</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Mon, 09 Mar 2009 20:36:07 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-4338748271439740201</guid><description>If you've dealt with legacy encryption schemes across multiple platforms, you know what a chore it can be to deal with the various encoding options, the character sets, etc.  Sure, Microsoft provides various short-cuts for converting hex strings to/from byte arrays (BitConverter, Encoding.ASCII.GetBytes, etc) that seem to sometimes work depending on the details of what you're doing and the systems involved..  but time and again I wind up going back to an old tried-and-true method shown below.&lt;br /&gt;&lt;br /&gt;&lt;pre class="c-sharp" name="code"&gt;&lt;br /&gt;       /// &amp;lt;summary&amp;gt;&lt;br /&gt;       /// Convert string to byte_array&lt;br /&gt;       /// &amp;lt;/summary&amp;gt;&lt;br /&gt;       /// &amp;lt;param name="strInput"&amp;gt;&lt;br /&gt;       private byte[] String_To_Bytes(string strInput)&lt;br /&gt;       {&lt;br /&gt;           // i variable used to hold position in string&lt;br /&gt;           int i = 0;&lt;br /&gt;           // x variable used to hold byte array element position&lt;br /&gt;           int x = 0;&lt;br /&gt;           // allocate byte array based on half of string length&lt;br /&gt;           byte[] bytes = new byte[(strInput.Length) / 2];&lt;br /&gt;           // loop through the string - 2 bytes at a time converting&lt;br /&gt;           //  it to decimal equivalent and store in byte array&lt;br /&gt;           while (strInput.Length &gt; i + 1)&lt;br /&gt;           {&lt;br /&gt;               long lngDecimal = Convert.ToInt32(strInput.Substring(i, 2), 16);&lt;br /&gt;               bytes[x] = Convert.ToByte(lngDecimal);&lt;br /&gt;               i = i + 2;&lt;br /&gt;               ++x;&lt;br /&gt;           }&lt;br /&gt;           // return the finished byte array of decimal values&lt;br /&gt;           return bytes;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       /// &amp;lt;summary&amp;gt;&lt;br /&gt;       /// Convert byte_array to string&lt;br /&gt;       /// &amp;lt;/summary&amp;gt;&lt;br /&gt;       /// &amp;lt;param name="bytes_Input"&amp;gt;&lt;br /&gt;       private string Bytes_To_String(byte[] bytes_Input)&lt;br /&gt;       {&lt;br /&gt;           // convert the byte array back to a true string&lt;br /&gt;           string strTemp = "";&lt;br /&gt;           for (int x = 0; x &lt;= bytes_Input.GetUpperBound(0); x++)&lt;br /&gt;           {&lt;br /&gt;               int number = int.Parse(bytes_Input[x].ToString());&lt;br /&gt;               strTemp += number.ToString("X").PadLeft(2, '0');&lt;br /&gt;           }&lt;br /&gt;           // return the finished string of hex values&lt;br /&gt;           return strTemp;&lt;br /&gt;       }&lt;/pre&gt;&lt;br /&gt;This allows you, for example, to go from a string value of say "A5B2FFD0" back and forth between the equivalent byte array { 0xA5, 0xB2, 0xFF, 0xD0 }.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-4338748271439740201?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">11</thr:total></item><item><title>Visual Studio 2008 Hotfix Rollup</title><link>http://programmerramblings.blogspot.com/2008/02/visual-studio-2008-hotfix-rollup.html</link><category>Visual Studio 2008</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Thu, 21 Feb 2008 21:41:48 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-3632808979395871647</guid><description>If you haven't already, you need to go download the Visual Studio 2008 hotfix rollup right now!  This update fixed some of my biggest performance-related gripes with Studio 2008.  It should really be on Windows Update.&lt;br /&gt;&lt;br /&gt;The main reference I've found to it is on Scott Guthrie's &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/02/08/vs-2008-web-development-hot-fix-roll-up-available.aspx"&gt;blog&lt;/a&gt; (but the hotfix itself is on MS Connect &lt;a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;This is one you definitely don't want to miss.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-3632808979395871647?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Visual Studio 2008 Color Schemes (AKA Themes)</title><link>http://programmerramblings.blogspot.com/2008/02/visual-studio-2008-color-schemes-aka.html</link><category>Visual Studio 2008</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Mon, 08 Sep 2008 22:39:16 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-8434849337511519178</guid><description>If you've never tried a different color scheme for Visual Studio - you are surely missing out.&lt;br /&gt;&lt;br /&gt;Check out Thomas Restrepo's ready to go &lt;a href="http://www.winterdom.com/weblog/2007/11/22/VS2008ColorSchemes.aspx"&gt;themes&lt;/a&gt; that were originally created for Visual Studio 2005 - but have recently been ported to Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;Ragnarok Blue is my personal favorite (although I did have to go through and drop the font size a few points - it seemed HUGE on my setup). I've been using it for several weeks now and it goes great with my black vista themed desktop.&lt;br /&gt;&lt;br /&gt;UPDATE:  9/8/2008 - for more great themes check out &lt;a href="http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx"&gt;Scott Hanselman's blog&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-8434849337511519178?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Microsoft's DreamSpark Program for Students</title><link>http://programmerramblings.blogspot.com/2008/02/microsofts-dreamspark-program-for.html</link><category>Applications</category><category>.NET</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Sat, 04 Apr 2009 21:48:41 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-158002037516736654</guid><description>UPDATE: 2/20/2008 - 8:43PM&lt;br /&gt;I received my email from JourneyEd with the link to verify/activate my student status. Upon clicking it, I successfully registered my hotmail acct with student status and I have full access to the DreamSpark downloads. Downloading my VS2008Pro right now.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In Microsoft's latest attempt to combat freebie open-source programming tools - they've come up with a new program called &lt;a href="https://www.dreamspark.com/default.aspx"&gt;DreamSpark&lt;/a&gt;. The program basically provides free copies of several of Microsoft's top development-related applications (and we're not talking the Express Editions here - although of course those can also be downloaded for free) to current students in several different countries :&lt;br /&gt;SQL Server 2005 Developer Edition&lt;br /&gt;Visual Studio 2008 Pro&lt;br /&gt;Expression Studio&lt;br /&gt;Windows Server 2003 Standard&lt;br /&gt;etc...&lt;br /&gt;&lt;br /&gt;These are the full versions of the software - no strings attached - for current students.  BUT, read the EULA fine print - you can NOT develop and sell software using these (unlike the Express Editions).  These are for "educational" purposes *only*. &lt;br /&gt;&lt;br /&gt;You start by verifying your enrollment in a university.  There's a small number of universities listed in a "quick verification" dropdown on the site, but even if your university isn't listed - you can use &lt;a href="http://www.journeyed.com/home.asp"&gt;JourneyEd.com&lt;/a&gt; to verify your student status.&lt;br /&gt;&lt;br /&gt;Being a current student at a local university - I figured I'd give it a shot. Now of course my University wasn't listed in the quick-access dropdown - so I had to go the JourneyEd route. It's actually a bit misleading as I continued through JourneyEd's verification process expecting to have to pay "$2.95" for "instant verification" - but when it came time to pay, it basically skipped-over the payment process showing a balance of $0. Maybe I didn't fully read the details? I was clicking Continue pretty quickly trying to get through the signup process... regardless, I'm now anxiously awaiting an email "within 3 hours" containing my download link back to DreamSpark to complete my verification process in the hopes of geting my hands on a free copy of Studio 2008 Pro.&lt;br /&gt;&lt;br /&gt;Kudos to Microsoft for the freebies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-158002037516736654?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>LINQPad</title><link>http://programmerramblings.blogspot.com/2008/02/linqpad.html</link><category>LINQ</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Sun, 10 Feb 2008 21:22:21 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-8722628349651004919</guid><description>For those that haven't heard - there's a great new free LINQ utility out called &lt;a href="http://www.linqpad.net/"&gt;LINQPad&lt;/a&gt;. I have to credit Robert Shelton's &lt;a href="http://rshelton.com/archive/2008/02/04/free-download-linqpad-this-is-a-must-have-for-every.aspx"&gt;blog&lt;/a&gt; for turning me on to this little gem.&lt;br /&gt;&lt;br /&gt;Great for quickly testing a LINQ statement, accessing data, or just learning about LINQ.&lt;br /&gt;&lt;br /&gt;Completely free - you can't go wrong. Download it now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-8722628349651004919?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Overclocking my Q6600</title><link>http://programmerramblings.blogspot.com/2008/02/overclocking-my-q6600.html</link><category>Overclocking</category><category>Hardware</category><author>noreply@blogger.com (Kenneth Scott)</author><pubDate>Tue, 05 Feb 2008 18:18:38 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2706170878552557520.post-8448926545677585928</guid><description>I finally got around to overclocking my Q6600 2.4ghz this past week. After much patience and many hours of Prime95 testing, I seem to have what I believe to be a stable overclock of 3.2ghz on air cooling (non-stock heatsink/fan).&lt;br /&gt;&lt;br /&gt;For reference, this is my setup:&lt;br /&gt;abit IP35 Pro&lt;br /&gt;Q6600 2.4ghz (G0) - running @ 3.2ghz&lt;br /&gt;EVGA 8800 GT SC&lt;br /&gt;OCZ Reaper HPC DDR2 6400 (2x1gb)&lt;br /&gt;Arctic Cooling Freezer 7 Pro&lt;br /&gt;Antec P180 Case (4x120mm fans @ medium speed)&lt;br /&gt;nSpire 650w PSU&lt;br /&gt;&lt;br /&gt;Custom BIOS volts/settings:&lt;br /&gt;CPU Bus 356mhz&lt;br /&gt;CPU core - 1.30v&lt;br /&gt;DDR2 - 2.175v&lt;br /&gt;RAM timings set manually to 4-4-4-15-42-2T&lt;br /&gt;RAM ratio 1:1&lt;br /&gt;everything else Auto/default&lt;br /&gt;&lt;br /&gt;Idle temps for the 4 cores respectively: 42 42 36 36&lt;br /&gt;Load temps for the 4 cores respectively: 62 62 56 56&lt;br /&gt;&lt;br /&gt;* Temp readings taken using &lt;a href="http://www.alcpu.com/CoreTemp/"&gt;Core Temp 0.96.1&lt;/a&gt;&lt;br /&gt;I also did temp testing with &lt;a href="http://www.almico.com/sfdownload.php"&gt;SpeedFan&lt;/a&gt; and abit's uGuru app, but they proved inconsistent. Core Temp may be a hair conservative, but it's far more accurate than the others.&lt;br /&gt;&lt;br /&gt;* Voltage readings taken using abit's uGuru app (which should match your BIOS readings). The only other app that came close to uGuru consistency was &lt;a href="http://www.cpuid.com/cpuz.php"&gt;CPU-Z&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;* Load testing was done using &lt;a href="http://www.softpedia.com/get/Others/Home-Education/Prime95.shtml"&gt;Prime 95 v25.5&lt;/a&gt; (Multi-Core version) over periods of up to 8 hours doing first Torture testing and later Blend testing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706170878552557520-8448926545677585928?l=programmerramblings.blogspot.com'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>
