27. May 2010 10:19
Okay, I'm getting really tired of seeing posts like this one... So I figured I'd take some time to debunk the thing.
More...
28. April 2010 14:40
I was reading an article on Google's use of hash-bang in order to provide a consistent means of Ajaxy content for crawling/display. There are three points to resolve here. 1. Handling those cases where someone posts an ajaxy url, with the hash endpoint to facebook or twitter so that the search engines have a convention to handle these types of urls. 2. Being able to deal with the Ajaxy endpoint, the original content and the ajax callback content. 3. Being able to deal with those browsers that don't have scripting.
It got me thinking, how would one could work with progressive URL's via MVC and a few thoughts occurred to me. First, if the controller name is always the first portion of the url from the application base, if the MVC routing engine could simply replace the ?_escaped_fragment_= portion of the uri to be equal to the original route. For example http://mysite/controller/action/1?_escaped_fragment_=/otheraction/2 would be equivalent to http://mysite/controller/otheraction/2 on the backend. Second, How difficult would it be for the default view engine to be transposed in the instances of an expected response type give html, vs js. Similar to how WCF over http handles JSON via the same endpoints as XML. I know this has been discussed in the past.
Where this leads me, is thinking it might be nice to have an ASP.Net MVC 2 based framework, with conventions for handling these scenarios as a default. I like ASP.Net MVC quite a bit, and have followed Castle and Fubu as well. I'm merely thinking that it would be nice if there were a default starter kit towards creating a browser and search engine friendly Ajaxy application. It really isn't easy. I think that the google hash-bang solution leaves out the people that don't have scripting enabled, getting a hash-bang endpoint is near worthless, save for a <noscript>script disabled indexable links here</noscript>. And progressive enhancement (aka Hijax) techniques don't allow for a browser engine to properly index copy/pasted urls. Having some level of convention to support both is necessary. I think it's equally necessary for google to post the _escaped_fragment_ based urls in the search results for those users who have scripting disabled.
19. April 2010 11:07
Just a short little post, I do intend to followup my last post with a post with code on combining/minifying your JavaScript and CSS, this just caught my attention, and wanted to mention it.
In the process of doing some technical screenings, it is really suprising how many people don't understand or even know about the HttpContext Items Collection in ASP.Net. More...
13. April 2010 10:59
I've been working on a number of web based applications recently, and have taken to using a few techniques that I thought I would share. I won't be sharing the code so much, which is ASP.Net centric, but will discuss what I am trying to accomplish.More...
1. April 2010 15:19
I'm currently working on a project where one of the applications has a subform, or child form that has interactions that are separate from the main page within the application. The main page is essentially a filter form, with a results grid. Each item in the grid displays a child form, when the child form is completed, the original screen is displayed again.
Sounds simple enough right? Well, the business desire is to have the filter option form keep its' settings when returning to the page. My initial solution was to use a jQueryUI dialog based option (via an IFrame). Which works great, except in certain conditions IE7 flickers when the mouse moves in/out of the IFrame itself if there are scroll bars present. ugh.
I didn't want to use cookies, or server-side session state as these will affect all windows using the main form. If a user launches the app in a new window, with different filters set, I didn't want these windows to effect each other. Then it occurred to me, I could use window.name to store the state of the form when entering, and leaving the page. I tend to store an "__original_value__" for each form element when a page loads, that way its' easy enough to return to default values later on via code. More...
23. February 2010 19:08
Okay, so I wanted to return a paged result set from a Stored Procedure in Microsoft SQL Server in T-SQL.
The results in question can be easily fed via a web service endpoint to a Silverlight, DHTML or other dynamic
grid. My own use is to populate a jqGrid.
The features I need are to be able to return only the relevant results for the current page, as well as a
count of the total rows available. I need to be able to input the current page number, an arbitrary page
size, as well as dynamically sort on a given column. My real world use is a fairly complex set of joined
tables, with several input parameters, so I am going to limit me queries to one table with the following
format:
CREATE TABLE MyList (
[id] UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),
[created] DATETIME NOT NULL DEFAULT GETDATE(),
[name] NVARCHAR(100) UNIQUE NOT NULL DEFAULT '',
[description] NVARCHAR(250) UNIQUE NOT NULL DEFAULT ''
);
More...
15. February 2010 11:14
Okay, this is a quick one. There are several states that can be considered empty in JavaScript, a non-numeric value in a number, an invalid date, and empty string, an undefined value, and a null value. The issue is that some of these require testing against isNaN, and others will evaluate as matching null or an empty string (ex: the number zero and the boolean false). What I wanted was a simple method to check for a non-empty object or string, here it is.
function isEmpty(obj) {
if (typeof obj == 'undefined' || obj === null || obj === '') return true;
if (typeof obj == 'number' && isNaN(obj)) return true;
if (obj instanceof Date && isNaN(Number(obj))) return true;
return false;
}
How it works, is first it tests for an 'undefined' object, an object that is explicitly equal to null, or explicitly equal to an empty string. If it matches, it's empty. From here there's some more specific checking, if it's a number type of variable, and isNaN (Not a Number), then it's empty. If it's a date, and Number(obj) (which gets the value of the date as a Number) isNaN, then it's an invalid date, and ergo isEmpty. Otherwise the isEmpty returns false (valid, non-empty value). Hope this helps some of you. :)
22. July 2009 10:52
Okay, so you love the Firebug Console, and related output to the console tab within Firebug. Don't we all, however there is a minor problem in leaving in all your log, and debug (etc) statements, and that is the fact that the console object doesn't exist in other browsers, or Firefox without Firebug. You will want to put the script segments below into a file that is called before other scripts on your page. More...
13. May 2009 02:34
Okay, I love Javascript. It is hands down my favorite language (C# is a near second). In fact, it was the first language I ever learned, even before having a good handle on html markup in the mid-90s. I used it server-side with Livewire on Netscape server. I transitioned to (now Cassic) ASP, and picked up vbscript (COM enumerations via JScript were so evil). When .Net first came out, i hacked my way through using the JScript .net command-line compiler, and early ASP.Net (ASP+), after translating a litteral ton of code from VB.Net and C# samples, I caved and learned C#. Allong the way, I picked up on several SQL Dialects, VB6, some perl and others; but I always get back to Javascript. More...
19. December 2008 04:53
The past few weeks, I've been working on Apollo.Common, which is meant to provide some easier to use functionality to enterprise applications. A lot of this functionality, and more is provided by the MS PnP team's Microsoft Enterprise Library. However, ent-lib tends to be overly complex, difficult to use, and require a lot of customization before you can get moving. I want Apollo.Common to be easy to use, implement and deploy with a minimal learning curve. More...