Scott Guthrie has a good article on his blog about building a ToJSON() Extension Method using .NET 3.5
Extension methods allow developers to add new methods to the public contract of an existing CLR type, without having to sub-class it or recompile the original type. In doing so they enable a variety of useful scenarios (including LINQ). They also provide a really convenient way to add a dash of "syntactic sugar" into your code.
Read the complete article here:
http://weblogs.asp.net/scottgu/archive/2007/10/01/tip-trick-building-a-tojson-extension-method-using-net-3-5.aspx
Tuesday, October 2, 2007
Building a ToJSON() Extension Method using .NET 3.5
Posted by
Denis
at
8:58 AM
0
comments
Labels: .NET 3.5, Extension Method, JSON
Wednesday, September 19, 2007
Microsoft Codename Astoria - Sept 2007 Community Technology Preview Available For Download
Brief Description
(CTP Refresh for Visual Studio 2008 Beta 2)The Microsoft Codename "Astoria" CTP toolkit enables developers to create and consume Data Services for the Web. These services expose application data over a simple HTTP interface that can be consumed by AJAX-based web sites and Rich Interactive Applications.
Overview
The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within corporate networks and across the internet. The data service is reachable over regular HTTP requests, and standard HTTP verbs such as GET, POST, PUT and DELETE are used to perform operations against the service.
The payload format for the data exchanged with the service can be controlled by the client and all options are simple, open formats such as plan XML and JSON.
The use of web-friendly technologies make it ideal as a data back-end for AJAX-style applications, Rich Interactive Applications and other applications that need to operate against data that is across the web.
The first Astoria CTP is a dual release, making Astoria available in the form of downloadable bits that can be used to build data services that are entirely contained within a single computer or network and as an experimental online service that you can use to create online stores that are hosted by Microsoft and are accessible over the internet.
This September 2007 CTP is mostly a refresh of the past May 2007 that enables developers to use Astoria together with Visual Studio 2008 Beta 2 and the ADO.NET Entity Framework and Tools Beta 2.
Download it here: http://www.microsoft.com/downloads/details.aspx?FamilyId=0FA1413C-CB55-4577-960E-0F3491847F58&displaylang=en
Posted by
Denis
at
9:58 AM
0
comments
Labels: ADO.NET Entity Framework, Ajax, Astoria, JSON, Visual Studio 2008
Tuesday, August 21, 2007
Video: Programming JSON with WCF in .NET Framework 3.5
Channel 9 has posted another interesting video, from the site:
Technical Evangelist Matt Winkler meets up with Eugene Osovetsky and Ghenadie Plingau, a PM and developer, from the WCF team to talk about returning JSON from a WCF service. JSON (JavaScript Object Notation) is s text based serialization of a JavaScript object, allowing one to new up a variable right from the string of JSON. Eugene hows how a developer can use the WCF programming model to serve JSON to AJAX clients. We also talk about how this is implemented in WCF as well as cool applications of this, namely to call WCF services from AJAX. He then shows off a cool tank game sample that allows two individuals to compete via a JavaScript game that is communicating with WCF.
Listen to the podcast(MP3)
Listen to the podcast(WMA)
Download the Video
Watch the Video
Posted by
Denis
at
5:15 AM
0
comments
Labels: JSON, Orcas, Video, Visual Studio 2008, WCF
Tuesday, July 3, 2007
Microsoft .NET Framework 3.5 June 2007 Community Technology Preview Released
Brief Description
Microsoft .NET Framework 3.5 contains many new features that are compatible with both .NET Framework 2.0 and .NET Framework 3.0. .NET Framework 3.5 includes servicing for .NET Framework 2.0 and .NET Framework 3.0.
Overview
.NET Framework 3.5 builds incrementally on the new features added in .NET Framework 3.0, for example, Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF) and Windows CardSpace. In addition, .NET Framework 3.5 contains a number of new features in several technology areas. These new features have been added as new assemblies to avoid breaking changes. They include the following:
Deep integration of Language Integrated Query (LINQ) and data awareness. This new feature will let you write code written in LINQ-enabled languages to filter, enumerate, and create projections of several types of SQL data, collections, XML, and DataSets by using the same syntax.
ASP.NET AJAX lets you create more efficient, more interactive, and highly-personalized Web experiences that work across all the most popular browsers.
New Web protocol support for building WCF services including AJAX, JSON, REST, POX, RSS, ATOM, and several new WS-* standards.
Full tooling support for WF, WCF, and WPF, including the new workflow-enabled services technology.
New classes in .NET Framework 3.5 base class library (BCL) address the most common customer requests.
Download it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=e6fd8663-8b77-4649-8d36-3830e18528fa&DisplayLang=en
Posted by
Denis
at
12:16 PM
0
comments
Labels: Ajax, C# 3.0, CTP, DLINQ, JSON, LINQ, POX, REST, Visual Studio Orcas, Windows Presentation Foundation, Windows Workflow Foundation, WPF, XLINQ
Monday, May 7, 2007
Video: Astoria Data Services
Channel 9 has their latest video up on their site
"Meet Pablo Castro one of the folks behind Astoria. Astoria exposes "data services" that enable applications to access and manipulate data over regular HTTP connections, using URIs to identify pieces of information within the data service, and simple payload formats such as XML and JSON to represent the data exchanged between the client and the server. In this interview Pablo goes deep whiteboarding out Astoria. If you want to go even further on Astoria check out Pablo's session from Mix."
Download the video here: http://channel9.msdn.com/ShowPost.aspx?PostID=305985#305985
Tuesday, May 1, 2007
Projects Jasper And Astoria Announced
Astoria
Project Codename “Astoria”
The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over regular HTTP requests, and standard HTTP verbs such as GET, POST, PUT and DELETE are used to perform operations against the service. The payload format for the service is controllable by the application, but all options are simple, open formats such as plan XML and JSON. Web-friendly technologies make Astoria an ideal data back-end for AJAX-style applications, and other applications that need to operate against data that is across the web.
To learn more about Project Astoria or download the CTP, visit the Project Astoria website at http://astoria.mslivelabs.com/.
Jasper
Project Codename “Jasper”
Project Jasper is geared towards iterative and agile development. You can start interacting with the data in your database without having to create mapping files or define classes. You can build user interfaces by naming controls according to your model without worrying about binding code. Project Jasper is also extensible, allowing you to provide your own business logic and class model. Since Project Jasper is built on top of the ADO.NET Entity Framework, it supports rich queries and complex mapping.
To learn more about Project Jasper visit the ADO.NET Blog at http://blogs.msdn.com/adonetTo download the Project Jasper CTP visit http://www.microsoft.com/downloads/details.aspx?FamilyId=471BB3AC-B31A-49CD-A567-F2E286715C8F&displaylang=en.
>>Since Project Jasper is built on top of the ADO.NET Entity Framework
Posted by
Denis
at
5:33 AM
0
comments
Labels: ADO.NET Entity Framework, JSON, MIX07
Thursday, April 19, 2007
Screencast: Virtual Earth with Ajax and JSON
Watch the screencast here: http://channel9.msdn.com/ShowPost.aspx?PostID=301830#301830
This is the introduction video to Virtual Earth using some simple java script and maps.live.com. If you're interested in using AJAX Web Services and JSON have a look at the rest of the content from the presentation: http://www.soulsolutions.com.au/Articles/ScalableVirtualEarth/tabid/105/Default.aspx
Posted by
Denis
at
10:37 AM
0
comments
Labels: Ajax, JSON, Screen Cast, Virtual Earth
Sunday, April 8, 2007
ASP.NET AJAX: Message Length Exceeded Error Fix: Increase Your Max Json Length
If you get the Message Length Exceeded error then open your web.config file and increase maxJsonLength to something bigger than 500
Look for this tag: <jsonSerialization maxJsonLength="500">
Do not make it too big because you might be introducing other problems ;-)
Posted by
Denis
at
9:30 AM
1 comments
Thursday, April 5, 2007
ASP.NET Ajax Not Susceptible To JSON Hijacking Attacks
ASP.NET AJAX Web Methods do not enable HTTP GET requests by default
ASP.NET AJAX 1.0 by default only allows the HTTP POST verb to be used when invoking web methods using JSON, which means you can't inadvertently allow browsers to invoke methods via HTTP GET.
ASP.NET AJAX 1.0 requires a Content-Type header to be set to "application/json" for both GET and POST invocations to AJAX web services. JSON requests that do not contain this header will be rejected by an ASP.NET server. This means you cannot invoke an ASP.NET AJAX web method via a <script src=""> include because browsers do not allow append custom content-type headers when requesting a JavaScript file like this.
Read the details here:http://weblogs.asp.net/scottgu/archive/2007/04/04/json-hijacking-and-how-asp-net-ajax-1-0-mitigates-these-attacks.aspx
Posted by
Denis
at
6:28 AM
0
comments