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 »

YUI Compressor and NAnt

Posted by & filed under AthleticHost, Web Development.

I have been working on creating a DotNetNuke Skin for AthleticHost.com.   In order to simplify deployment of the skin I wanted to add it as an extension to DNN rather that upload it via FTP.   I choose to use NAnt to build the extension install file.   In an effort to increase page performance I decided… Read more »

JavaScript Variable Pattern

Posted by & filed under Web Development.

To help make writing and maintaining JavaScript easier in ASP.NET I have started to use a pattern that isolates the JavaScript variables away from the core script.  By doing this I can avoid a bunch of string concatenation in my server side code and embedded code blocks in my .aspx page when rendering dynamic JavaScript. … Read more »

Calling a button click from JavaScript in ASP.NET

Posted by & filed under Web Development.

ASP.NET web forms page have a JavaScript method for handling PostBacks called “__doPostBack”.  This function is used to submit button clicks back to the server. function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } The cool thing is that you can take advantage of… Read more »