Archive for the ‘ASP.NET’ Category

Microsoft ASP.NET AJAX 4.0 Preview 5 Released at CodePlex

As we know, ASP.NET AJAX 4.0 Preview 4 had earlier included outstanding client-centric development features like client-side data binding & client side templates ala XAML for WPF, implementation of observer pattern from scratch in JavaScript, data view controls, support for data sources like ADO.NET Entity Framework, LINQ to SQL etc..

Microsoft has just released ASP.NET AJAX Preview 5 at CodePlex:

In Preview 5 of ASP.NET AJAX 4.0 there has been improvement on the client-side data story (data binding et al.) introduced in previous previews of ASP.NET AJAX. In this release, there has been bug fixes and feature enhancements for the following:

1.  Dynamic and recursive templates

2.  Binding Converters

3.  Compatibility with the ASP.NET UpdatePanel

The download includes the following:

–          Help file that contains API reference documentation for Preview 5 of ASP.NET AJAX 4.0

–          A Visual Studio project containing code samples for using many of the features of ASP.NET AJAX including those that were added onto the “Preview 5” bits. Here are those:

  • Examples of Data View & Client Template usage with .NET ASMX Web Service, Wcf Service, ADO.NET Data Service both in declarative and imperative ways.
  • Master Detail Live Binding scenarios with ADO.NET DataContext for CRUD (Create, Read, Update, Delete) operations.
  • ObservableData with JavaScript which has been implemented from scratch using the classic observer design pattern.
  • JSONP Usage.
  • Recursive Template Usage.

Two new script files have been included with the download for UpdatePanel compatibility issues basically:



Here I am describing few of the major changes in this release as were outlined in the release notes:

Declarative Attribute Changes

It is no longer necessary to include a sys:activate attribute on the body of a page containing declarative markup.

Top Level Bindings

Support for “top level” expressions and bindings. Previously these were only supported within the context of a template marked with sys-template. For example, to bind the value of an input to a javascript object, you might do this:

<input sys:value="{binding bar,source={{foo}} }" />

This binds the value to the ‘bar’ field of a global ‘foo’ object. You can use other bindings to update the value, or directly with Sys.Observer:

Sys.Observer.setValue(foo, “bar”, “newValue”);

Binding the content of an element as text or HTML

You may bind to the content of a node using the new sys:innertext and sys:innerhtml attributes. Choose the appropriate attribute depending on whether or not you want to allow HTML in the value to be interpreted as HTML. For example, if you have a variable named ‘foo’ set to the value “<p>hello</p>”:

<div sys:innertext=”{{ foo }}”></div>

Will result in seeing <p>hello</p> in the browser.

<div sys:innerhtml=”{{ foo }}”></div>

Will result in the <p> tag being interpret as a paragraph tag.

The difference is in how the value is inserted. “sys:innertext” injects a text node with the given value. “sys:innerhtml” sets the innerHTML of the target element. Note that while “innerText” is an Internet Explorer only concept, “sys:innertext” is not an Internet Explorer only attribute. The name is semantically correct, despite it being implemented differently than IE’s native innerText field.

DataView Improvements

DataView now has the following events:

Binding Converters and Expandos

Bindings now support the concept of named converters that are set onto the Sys.Binding.converters field. There are none out of the box, but you may now define your own and refer to them by name. For example:

{binding foo,convert=myconverter}

This would look for a converter defined like so:

Sys.Binding.converters.myconverter = function(valueToConvert, binding) {

// convert

In addition, you may now set expandos onto the binding object and refer to them from your converter. This allows you to semantically describe what you want in a binding in any custom way you require for any specific binding. It allows you to parameterize a converter function. For example, this example sets a ‘format’ expando on the binding object despite that not being a field or property the binding natively has:

{binding foo,convert=format,format=MM/dd}
Sys.Binding.converters.format = function(value, binding) {

// binding.format === MM/dd


UpdatePanel Support

Preview 4 was not compatible with UpdatePanel in ASP.NET 3.5 due to changes to the data format UpdatePanel renders, and the inline script it renders in ASP.NET 4.0. The 4.0 scripts are now designed to work with either 3.5 or 4.0 on the server. To support UpdatePanel with these scripts, you must replace the partial rendering script (MicrosoftAjaxWebForms.js) with the 4.0 version. If you do not use an update panel, you must disable partial rendering.

Weekly Link Roundup – 2

Links published on May 04, 2009:

Math world, simple mental calculations or what’s going on with education?

Most interesting math blog post I have read for a long time. Have a read guys and tell me how you find it.

Programmer Competency Matrix:

Panoramic Image & Viewer related resources:

File conversion utility for panoramic photos:

Automatic image stitching:

Panoramic Image App (Commercial):

Panorama Gallery:

Panoramic Viewer:

TDD Links:
A Conversation with Martin Fowler
Mocks Aren’t Stubs
Learn about .NET Unit Testing with Typemock

Old Version Downloads:

10 Youtube URL Tricks You Should Know About

100 Best JavaScript Resources

Performance killer: Disk I/O

Top 20 Best Agile Development Books, Ever

Top 100 Best Software Engineering Books, Ever

Top 20 Programming Books

Top 10 Concepts That Every Software Engineer Should Know

Securing ASP.NET Applications

The ADO.NET Entity Framework must read:

Introducing the Entity Framework [MSDN]
The ADO.NET Entity Framework Overview
ADO.NET Tech Preview: Entity Data Model

Introduction to the Entity Framework [Code Project]

Windows Communication Foundation must read:

Fundamental Windows Communication Foundation Concepts
What Is Windows Communication Foundation?

A Guide to Designing and Building RESTful Web Services with WCF 3.5

Howto Dynamically Insert Javascript And CSS:

This is a short and sweet little tutorial to show you how to dynamically insert a new Javascript (or style sheet) into your web pages, and explores how you can exploit cross-domain includes in your applications.

As JSON and DHTML start to get pushed more and more to the forefront of web-based applications, the web designer is faced with a new problem: how to dynamically insert a script element into an existing web page. It won’t take long to figure out that ajax loads and innerHTML injections won’t work.

Yahoo! Pipes and JQuery : Goodbye Same Origin Policy

URL Shorteners:

Interview Tips:

LINQ to Entities:

LINQ Learning Guide: LINQ to Entities,295582,sid8_gci1299600,00.html

The ADO.NET Entity Framework Overview:

Parallelism Videos Galore

Writing LINQ Queries with the Entity Framework:

ASP.NET Dynamic Data Overview

Inheritance and Associations with Entity Framework Part 1

Model Domain Objects with the Entity Framework

Lambda the Ultimate : Programming Languages Weblog

Introduction to Domain Specific Languages

Good blog site on Patterns:

Pattern site on Hexagonal architecture

JSINQ – LINQ to Objects for JavaScript

JSINQ: LINQ style access for JavaScript objects

LINQ to SQL: SQL-CLR Type Mismatches (LINQ to SQL)

LINQ to SQL : Object Identity (LINQ to SQL)

Most interesting math blog post I have read for a long time. Have a read guys and tell me how you find it.