Skip to content

Category Archives: Web

Benchmarking a simple DOM based cloning template

10-Dec-09

Sara Chipps recently posted a simple DOM based clone template method she uses in one of her apps. "Easy HTML Templating with JQuery"

My template looks like this:
PLAIN TEXT
CODE:

<script id="ItemTemplate" type="text/html"

        <li class="item" value="|rowNumber|">

              <input type=”text” id=”input|rowNumber|” />

        </li>

    </script>

Now within [...]

A new JavaScript CDN from Microsoft

29-Sep-09

Microsoft announced a new Content Delivery Network for their ASP.NET AJAX JavaScript libraries and jQuery. This means that instead of hosting those libraries on your server, you can just link to the versions on Microsofts server. I made a simple page that takes a querystring parameter (q=) and uses the ASP.NET AJAX dynamic templates to [...]

ASP.NET MVC Tip – Return specific views for specific errors.

18-Mar-09

Earlier I had said to keep your controllers as thin as possible, that doesn't mean that they should necessarily just be two, or one, lines of code.
Take an instance where you are retrieving items from a web service in your controller. Let's say that you get a 404 error and your service will throw [...]

ASP.NET MVC tip – Don’t use the Content or Scripts directories for view specific files

17-Mar-09

ASP.NET MVC creates a default file structure for you when you create a new project. It includes a Scripts directory, which contains the MS AJAX and jQuery .js files, and a content directory, which contains a Master page and CSS files. I find this to be extremely cumbersome and it forces me to jump around [...]

ASP.NET MVC TIP – Keep your controllers and actions thin

16-Mar-09

When writing you controller actions, keep them short and sweet. Don't add a lot of actions and keep a close eye on the length of each action.
Whenever possible, I try to make my controller actions look something like this.
PLAIN TEXT
CODE:

public ActionResult DoSomething()

{

    MyModel model = MyService.GetModel();

    return View("MyView",model);

}

//or

public ActionResult DoSomethingWithAKey(int myKey)

{

    MyModel [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes