Formatting Dates with Knockout.js

Posted by & filed under Development, Web Development.

I am working on a couple of Silverlight projects using Microsoft Prism and found the MVVM pattern very powerful. The team at work is developing a single page HTML/Javascript application that is using Knockout as the MVVM framework. I wanted to bind a date using a custom format ‘dddd, MMMM dd, yyyy’. Since JavaScript doesn’t… Read more »

JavaScript: Using setInterval Within an Object

Posted by & filed under Web Development.

I had a need to use window.setInterval(code, delay) to a call a method on a JavaScript object every few seconds to rotate some content. However, I found that once setInterval called the code in the callback ‘this’ referenced ‘window’. However, I needed ‘this’ to reference the object that was called by setInterval. ContentTabs = { init: function… Read more »

Using the DotNetNuke Profile Photo in a Custom Module

Posted by & filed under Development, DotNetNuke.

private string GetUserPhotoUrl(UserInfo user) { if (user.Profile.Photo == null || user.Profile.Photo == "-1") return user.Profile.PhotoURL; else return VirtualPathUtility.ToAbsolute("~/LinkClick.aspx") + "?fileticket=" + user.Profile.Photo; } An anonymous user or a user without a profile photo will always get the default no_avatar.gif image.

DotNetNuke MVP Module Development: Tip #2 Disable AutoDataBind

Posted by & filed under Development, DotNetNuke, Web Development.

In DotNetNuke MVP Module Development: Tip #1 The AutoDataBind Property I suggested to use AutoDatBind to automatically bind up the user control.  However, there are times when no binding should occur.  For example, when a Cancel button is clicked the view should not be bound.  AutoDataBind should be disabled when no model is need. protected… Read more »

Quick Tip: Use JQuery to submit a TextBox.

Posted by & filed under Development.

Submitting a search box when <Enter> is pressed is a nice usability feature to provide.  Unfortunately, ASP.NET Web Forms and its requirement for a single <form> tag breaks this expected behavior when there is more than one submit button on the page.   This can be easily fixed with a JavaScript and JQuery.   Listening to the… Read more »

DotNetNuke MVP Module Development: Tip #1 The AutoDataBind Property

Posted by & filed under Development, DotNetNuke.

The DotNetNuke.Web.Mvp.ModuleViewBase sets a property called AutoDataBind = true. As a result the DataBind() method for the page is always called in the Page_PreRenderComplete event. If you use the following familiar snippet of code you find that your controls will be data bound twice. Once when your code calls DataBind() and a second time when… Read more »

How BOI2REX Became BOI2CotM

Posted by & filed under Cycling.

  What is BOI2CotM?  It is Boise to Craters of the Moon and that is as far as I got on my cycling trip across Idaho.  At 8 PM on day two I made a reluctant phone call to Tory.  “Hey, babe.”, I announced.  “Hi’”, she replied.  I knew she knew why I was calling…. Read more »

BOI2REX – Routes Have Been Finalized

Posted by & filed under Cycling.

Day 1.  Nampa to Mountain Home. I’ll start in Nampa and head south through Melba and end up at the Mountain Home RV Park in Mountain Home.  I’ll end the day with 2,605 feet of elevation gain and 88 miles on the bike.  There aren’t many places to get water, so I am going to… Read more »