Lotus Notes, Microsoft .NET, ASP.NET, Sharepoint, SQL Server

ExtJS is very powerful JavaScript library, perfect for creating rich graphical user interface in web browser. You can make applications of many purposes and integrate data from many sources and technologies using XML, JSON or own interchange format. On the other hand .NET provides great server side features like entity framework, Linq and many more powerful classes. In this article I would like to show You how to integrate both technologies in the most convenient way and use strengths from both of them.

Solution

When You are trying to access different data sources on different servers, the best way in today's world is to use web services. In this way You can build SOA solution, accessible by many suppliers using different technologies. When we have decided to use ExtJS as GUI part and ASP.NET as server part, it would be ideally to use ASP.NET web services directly. Natively ExtJS does not support SOAP XML data source. You can write own data proxy if You like, but I will show You that it is not necessary. ASP.NET webservices, starting from version 2.0 allows You to talk in JSON format instead of SOAP XML.

Like in most cases, when You want to configure behavior of .NET classes You can use attributes. In this we need to decorate web service class with ScriptService attribute (form System.Web.Script.Services namespace), and then decorate methods with ScriptMethod attribute. Class attribute does not need any configuration, but we have to add some to method decorator also. All we need to specify is method response format, in this case ResponseFormat=ResponseFormat.Json and allow to talk to web service method using GET HTTP method. That is all we need on server side, let's go then to GUI part.

In this scenario we have obtained data from ASP.NET WebService and show it in ExtJS data grid. This approach has one big disadvantage: WebService have to be located within the same domain. In the next article I will show You how to perform Cross domain call from ExtJS to ASP.NET web service in simple steps.

14
comments:

Hi Rafal,

it's very useful about "EXTJS and .Net web servicers" article, but still we are awaiting for your next related article for "how to consume the same .net webservice in cross-domain" using extjs. If you have any intermediate ideas please post it.

Looks this is a wonderfully architectural weblog well designed . Only unique web designing company in hyderabad can design similar sites or sites with a genuine layout that no othe companies can design.