Skip to main content

Latest Articles: .net framework 2.0


JSON in ASP.NET Ajax: Part 2. Calling a remote JSON Web Service from client script
Entry Date: Jun 2008 site: Geeks With Blogs Rating:
keywords:ASP .net; AJAX ASP .net; .net framework 3.0; Java Script; JSON; Web Services; Networking; ScriptManager;
Article Description:
Now, after the very futile example which accompanied the introduction to JavaScript Object Notation in my last post (by the way, I forgot to mention that this is what the fancy acronym stands for, but I'm sure you already knew that), let's go straight to the fun part, and see how we can leverage the flexibility of JSON (and ASP.NET AJAX, of course) to achieve some less trivial result. When developing a web application, we often need to aggregate data from different sources. You might argue this is no big news, as we've all used web services in a way or the other, and "mashup" is surely not an uncommon word these days. But probably, for most of us, the natural way to think of data returned from a web service call is XML. But XML is not exactly the easiest thing to parse on the client, nor a very succinct format. That's why a number of JSON web services have flourished lately. Probably the first that comes to mind is Google Maps' Geocoder (see here), but there are a lot more. If you are looking for inspiration you can have a look at xmethods. But today, we are focusing on some very, very interesting web methods kindly offered by Geonames.
Comments:

Quite good stuff, AJAX ASP .net + JSON at low level.

Most of us are used to let the AJAX ASP .net framework to do all the magic for us (JSON serialization / deserialization) in this post series you will learn the internals, and how to do it by your self, interesting thing to, for instance, serialize an array on a hidden field

Click Here To Navigate to the Article

Boost ASP.NET performance with deferred content loading
Entry Date: Apr 2008 site: Encosia Rating:
keywords:ASP .net; AJAX ASP .net; Performance; .net framework 3.0; Java Script; JSON; Web Services; Networking; HTML; DHTML; DOM; ScriptManager;
Article Description:

When rolled into the page life cycle of an ASP.NET WebForm, that red bar is one of your application’s greatest enemies. No matter how well you optimize the rest of the page, even one slow task can become the sole factor determining a user’s perception of the entire page’s performance.

In this post, I’m going to show you one way to circumvent that problem. By placing ancillary content in user controls and delaying their load until the core page content has been displayed, you can drastically improve perceived performance.

Comments:

Simple and nice sample about how to combine javascript calls to server side web services /script services in order to get an HTML and inject it using javascript / DOM inside a DIV using the property innerHTML.

If you just want to show readonly data this solution is excellent, users can keep on working on the page and once you get the info it will be loaded in background, if it's something that the users need to edit and post, things get a bit more difficult

Click Here To Navigate to the Article

Spelunking the DOM with Silverlight 1.1 - Part 2: Integrating Web Services
Entry Date: Jan 2008 site: MSDN Rating:
keywords:Hosting; VB .net; Silverlight; JSON; Web Services; VS 2008; DOM; Visual Studio 2008; XAML;
Article Description:
In the last installment you learned the basics of creating a Silverlight 1.1 application and integrating that application with the HTML DOM (See Spelunking the DOM with Silverlight 1.1 - Part 1). In this installment you will integrate your Silverlight 1.1 application with an ASP.NET Web Service.
Comments:

How to call web services using Silverlight 1.1.

This code is almost outdated, but it reflects an important gap... you need to do some tricks to call webservices on silverlight (to avoid cross domain errors), this article shows you how to make a workaround installing your code into IIS.

Click Here To Navigate to the Article

SILVERLIGHT 1.1 WEBSERVICES
Entry Date: Jan 2008 site: Silverlight Rating:
keywords:ASP .net; Silverlight; JSON; Web Services; VS 2008; .net framework 3.5; ASP .net Futures; Visual Studio 2008; XAML;
Article Description:
In this video, Jesse Liberty demonstrates how Silverlight 1.1 can display data retrieved from a web service using the controls available in the ASP.NET futures package, creating a seamless and integrated relationship between an ASP.NET application, a web-service and a Silverlight control, all assisted by the astonishing power of the enhanced Intellisense built into Visual Studio 2008.
Comments:

Interesting, how to consume JSON web services from Silverlight 2.0 (client side), how to link it to an standard ASP .net web project, and how to add a simple animation and run it programmatically, based on a given event.

Click Here To Navigate to the Article

How to enable session state in web services
Entry Date: Nov 2007 site: anubhavg blog Rating:
keywords:ASP .net; AJAX ASP .net; XML; Java Script; JSON; Web Services;
Article Description:
Some days back I was writing a few web services. I have coded web services many times, but never required to use Session State before. This time I required to check a few session variables before returning the correct data from the web service. I tried using the HttpSession like in a normal web page but got an error. After a little search found the right way to use HttpSession in webmethods.
Comments:

Web services are stateless and use SOAP and XML... Ehhh ummm ??? NOT ALWAYS

In AJAX Web applications, most of the times web services and page methods are just "private" for a given page or web application, taking this into consideration we have that:

  • --> SOAP is to heavy for HTTP traffic (we use AJAX to sky rocket performance and have minimum weight on our roundtrips to the server) and complex to handle using Javascript, it's better to serialize using JSON.
  • --> Webservices interacting with your web application will require most of the time to use the session web application object (security, values in session...) so no stateless for your web services. You could try to use WSE and... but things get quite complicated.

This article explains you how to enable session state for a given web method of your webservice, quite easy (just one line of code) and quite useful

Click Here To Navigate to the Article

ASP.NET Ajax Web Service
Entry Date: Nov 2007 site: dotnet Slackers Rating:
keywords:ASP .net; AJAX ASP .net; Java Script; JSON; Web Services;
Article Description:
In this article, I will answer some of the common questions which most of the developers face while working with ASP.NET Ajax Web Services.
Comments:

Superb article !!!

You can find on the internet articles about how to call a web service from javascript using AJAX ASP .net... things like hello word or sum two numbers... nice to start, but not very useful when you face real world projects.

In this article you will find this basic topics and advanced cool stuff: passing arrays of strings (JSON --> Server side serialization), adding a progress bar... 100 % useful and interesting a must read.

Click Here To Navigate to the Article

Tip/Trick: Cool UI Templating Technique to use with ASP.NET AJAX for non-UpdatePanel scenarios
Entry Date: Oct 2007 site: Scott Gus Blog Rating:
keywords:ASP .net; AJAX ASP .net; Viewstate; .net framework 3.0; Java Script; JSON;
Article Description:
This weekend I decided to focus my coding on some of the client JavaScript pieces in the ASP.NET AJAX framework that don't use UpdatePanels at all, and to experiment with alternative ways to use the server to easily generate HTML UI that can be dynamically injected into a page using AJAX. In the process I created what I think is a pretty useful library that can be used with both ASP.NET AJAX and other AJAX libraries to provide a nice template UI mechanism with ASP.NET, and which doesn't use or require concepts like postbacks or viewstate - while still providing the benefits of control encapsulation and easy re-use.
Comments:

AJAX ASP .net UpdatePanel is something very easy to use, but in some scenarios sucks, it's not real AJAX (just partial rendering) and carries all the weight of the page in each request (ViewState, ...)

As a better solution you can call script services or page methods: easy to code for a hello world sample and changing a simple label, but not for refreshing a Gridview

There's an in between solution... this link shows you a superb solution, not very hard to code, but quite useful: encapsulate the funcionallity that you want to refresh in an user control, and then only refresh that control, What happens with the view state and page request? Well Scott does a trick/hack: it uses a fake dummy page to make the request. The only weak point of this solution is that you have to avoid using the ViewState (at least for the user control).

Another thing to take into consideration is that is not something Official and supported from Ms, maybe if there are changes in the future this code won't work

Click Here To Navigate to the Article

Calling Web Services from Client Script in ASP.NET AJAX
Entry Date: Oct 2007 site: ASP.net Rating:
keywords:ASP .net; AJAX ASP .net; Java Script; JSON; Web Services;
Article Description:
This topic explains how to use to call a Web service from ECMAScript (JavaScript). To enable your application to call ASP.NET AJAX Web services by using client script, the server asynchronous communication layer automatically generates JavaScript proxy classes. A proxy class is generated for each Web service for which an element is included under the control in the page.
Comments:
Superb tutorial !!

Here you will find how to consume web service using Javascript plus AJAX (C# and VB .net samples available).

In a related link you will find how to generate a WebService that can be consumed by an AJAX Web Page, generating JSON.

PS:If in your project you are using ScriptManager on a master page, you will need to google for ScriptManagerProxy to implement this WebServicecalls from Javascript (a separted js file).

Click Here To Navigate to the Article

Why ASP.NET AJAX UpdatePanels are dangerous
Entry Date: Oct 2007 site: Encosia Rating:
keywords:ASP .net; AJAX ASP .net; .net framework 2.0; Java Script; JSON; Networking; DHTML;
Article Description:
If you’re like me, it’s hard to resist the lure of tossing a half dozen UpdatePanels on every page and reveling in AJAX goodness. The UpdatePanel makes AJAX trivially easy for anyone to implement, even without knowledge of what’s actually going on behind the scenes.
Comments:

Why UpdatePanels are not a silver bullet... you send the whole page in every request :-(.

You should choose carefully when to use UpdatePanels on your page or not (check on a remote server before thinking your solution is ok).

Click Here To Navigate to the Article

AJAX application architecture, Part 2
Entry Date: Sep 2007 site: MSDN Magazine Rating:
keywords:ASP .net; AJAX ASP .net; .net framework 2.0; Security; Java Script; JSON; Web Services; HTML; DHTML;
Article Description:
When using ASP.NET AJAX Extensions to transition your site to an AJAX experience, there are two main programming models to choose from: partial rendering and script services. In last month's column, I discussed partial rendering from a primarily architectural perspective. Simply put, with partial rendering, you don't need to change the underlying architecture of an ASP.NET application—it's an easy route to implementing some of the best elements of AJAX, such as no-flicker updates to pages on your site. This enhanced behavior is achieved by simply adding a few new server controls (specifically, ScriptManager and UpdatePanel) and having them silently perform a few tricks to transform a traditional postback in an asynchronous request run through the XMLHttpRequest object. This approach is pretty easy as it simply applies AJAX functionality to the existing Web development model.
Comments:

Serie of two articles: in the previous one you learn how to add some AJAX goodies to your old existing ASP .net application (update panel + scriptmanager).

In this second article Dino explores how to create pure AJAX applications. Radical change to the architecture and things starts to get hard to develop a real AJAX app (javascript every where, DHTML, DOM, ...).

My conclusion of this article is... AJAX ASP .net is very powerful, but right now we should think about creating mixed AJAX app's (some postbacks and some AJAX features like consuming webservices from the client side using JSON), without forgetting that AJAX is not only UpdatePanel (poor performance). It's a new technology and a lot of new functionallity has to come in newer versions.

Click Here To Navigate to the Article

Custom Client Side Drag and Drop Behavior in ASP.NET AJAX
Entry Date: Jun 2007 site: ASP Alliance Rating:
keywords:ASP .net; AJAX ASP .net; XML; Java Script; JSON; Web Services;
Article Description:
This article explains the step-by-step procedure of how to create a custom Drag and Drop behavior by implementing IDragSource and IDropTarget interfaces provided by ASP.NET AJAX client side framework, which will lead to a very attractive and user friendly User eXperience (UX).
Comments:

Step by step tutorial that shows you how to implement drag and drop using AJAX ASP .net.

Worth to read and to implement the sample, you will learn how drag and dropped is used and implemented, how to access the HTML controls via dom, and how to communicate asnynchronously with webservices using AJAX.

Beware, this drag and drop funcionallity works fine on IE, but not sure on some navigators like safari

Click Here To Navigate to the Article

Page (1) Of 2 Next Articles >>