What is CodePlex Foundation?
The CodePlex Foundation is a not-for-profit foundation created as a forum in which open source communities and the software development community can come together with the shared goal of increasing participation in open source community projects
(You can click on the image above to goto the website and learn more)
So the news of the day is that this foundation has created it’s first ‘gallery’, the ASP.NET Open Source Gallery.
What is a Gallery?
Galleries may be sponsored by a third-party organization, e.g. a commercial software company, or run by the Foundation. Galleries will rely on Foundation staff and volunteers to provide a set of support services, including administration, security, best practices and marketing.
Out of this gallery is the first project the ‘ASP.NET Ajax Library’. This project has a wiki setup to learn more, get the source code, view some sample applications, etc…
http://www.asp.net/ajaxlibrary/
Head over to the ‘Learn’ section at http://www.asp.net/ajaxlibrary/learn.ashx it gives an overview of the capabilities of the library.
Some of the examples are interesting as they provide a ‘imperative’, ‘declarative’, and ‘jquery’ approach.
My ‘favorite’ example is the one on :
‘HOW TO Call ASP NET MVC Controller Actions’
I’ll snag a few snippets off that page in a shorter format – go read for the full instructions.
First, a controller action with model class:
public JsonResult GetCustomers() { List<Customer> custs = new List<Customer> { new Customer { CustomerID = 1, FirstName = "John", LastName = "Doe", Age = 50 }, new Customer { CustomerID = 2, FirstName = "Jane", LastName = "Doe", Age = 47 } }; return Json(custs); }
ASP. NET makes it easy to return data as Json out of the box as you can see above.
To then call this controller/action from the view:
<script src="../../Scripts/MicrosoftAjax/start.js" type="text/javascript"></script> <script type="text/javascript"> Sys.require([Sys.components.dataView, Sys.scripts.WebServices], function() { var dataView = Sys.create.dataView('#CustomersTemplate', { dataProvider: "/Home/GetCustomers", autoFetch: true }); }); </script>
There is a ‘dataview’ defined above with the #CustomerTemplate referring to a html element on the page of id ‘CustomerTemplate’
ie.
<div id="CustomersTemplate" class="sys-template"> {{FirstName}} {{LastName}} </div>
This should give you an idea, the other examples covering different topics are available, with sample code snippets and instructions on how to use the code.
I feel they have done a good job putting this together in a easy to follow manner, and the technology presented isn’t complex.