MS AJAX 4.0 New Feature; Templates

John Katsiotis has a great example up on one of the new ASP.NET AJAX Features, client-side templates. This means that you can refer to properties in your HTML. John has a much better example on his blog, but essentially you can do stuff like this:

 


And your .NET code would basically return an object of type employee to your HTML. The framework will handle populating the input values based on the properties names assigned (e.g., value="{{ PropertyName}}"")
public static List GetVal()
{
        List emplist = new List();
        emplist.Add(new Employee { FirstName = "Jim", LastName = "Morrison"});
	return emplist;
}

public class Employee
{
 	public string FirstName { get; set; }
        public string LastName { get; set; }
}

Print | posted @ Saturday, December 27, 2008 7:30 PM

Comments on this entry:

No comments posted yet.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 
Twitter