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 [...]
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 [...]
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 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 [...]
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 [...]