Using jQuery to Consume ASP.NET JSON Web Services

AJAX, ASP.NET, JavaScript, UI, jQuery By Dave Ward on March 27th, 2008

Animated example of the RSS feed block from this article. In response to many of the articles here, I receive feedback asking how to achieve the same results without using ASP.NET AJAX. As much as I’m a fan of ASP.NET AJAX, I must agree that its JavaScript payload can certainly be a drawback in some situations.

My recent deferred content loading post is an excellent example of that. I was using jQuery for presentational effects, and using a ScriptManager to call a web service. Loading the JavaScript for both frameworks was a bit counterproductive, since the whole point was to improve initial load time.

In this post, I intend to correct that.

First, I’ll cover the two requirements necessary when calling an ASMX web service that’s being JSON serialized by the ASP.NET AJAX extensions. Then, I’ll show you how to do this with jQuery. Finally, I’ll update the deferred content loading example accordingly.

Click here to read the rest of this post »

Why my ASP.NET AJAX forms are never submitted twice

AJAX, ASP.NET, JavaScript, UI By Dave Ward on March 4th, 2008

Animated example of the button disabling technique in this article.The overzealous double-clickers amongst our users often make it desirable to temporarily disable the controls that trigger server side processing. Previously, I’ve shown you how to disable a button during a postback, how to disable a button during a partial postback, and even written a server control to automate the latter.

However, what if you wanted to be more thorough and disable all of the buttons on a page?

In this post, I’m going to show you how to do just that. I’ll also show you how to disable only the buttons in the UpdatePanel raising the event. Finally, for the jQuery users out there, I’ll show you how to simplify the process down to one line of code.

Click here to read the rest of this post »

Boost ASP.NET performance with deferred content loading

AJAX, ASP.NET, JavaScript, Performance, UI By Dave Ward on February 5th, 2008

FireBug graph of net requests
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.

When broken down into digestible chunks, the technique is easy to implement and lends your application a level of polish that your users are sure to appreciate. The four steps required to accomplish this will be: building the user control, statelessly rendering the control as HTML, providing progress indication, and using ASP.NET AJAX to request and inject that HTML.

Click here to read the rest of this post »

PostBack Ritalin Updated (v0.9)

AJAX, ASP.NET, PostBack Ritalin, UI By Dave Ward on January 30th, 2008

Another significant update to PostBack Ritalin is available today. Changes include:

v0.9 (1/30/2008)

  • Resolved all remaining issues with master pages. Nested naming containers should no longer cause any issues.
  • Added the ability to provide UpdatePanel specific WaitText and WaitImage properties for each MonitoredUpdatePanel.
  • Added correct handling for virtual paths in all WaitImage properties.
  • Added CSS to change cursor style to “wait” when hovering over the disabled control.
  • General improvements to client side code.

The download is available on the PostBack Ritalin page.

I have several more ASP.NET AJAX example posts and at least one book review in the pipeline. January has just been a very busy month so far (it started with our primary web server’s RAID array crashing on New Year’s Eve, so you can imagine). Stay tuned for more of what you’re used to here soon.

Highslide JS .NET Updated (v0.5)

AJAX, ASP.NET, Highslide, UI By Dave Ward on January 11th, 2008

A small update to Highslide JS .NET is available today. Changes include:

v0.5 (1/11/2008)

  • Updated embedded Highslide JS version to 3.3.6.
  • Cleaned up Alt and Title attribute handling.
  • Added TitleText property to HighslideImage.
  • Added LinkTarget property to HighslideImage.

The download is available on the Highslide JS .NET page, as always.

Click here to read the rest of this post »

4 ASP.NET AJAX JavaScript UI methods you should learn

AJAX, ASP.NET, CSS, JavaScript, UI By Dave Ward on January 9th, 2008

Wrapping up my series on some of ASP.NET AJAX’s less utilized client side functionality, this post will take a closer look at some of ASP.NET AJAX’s JavaScript UI helper functions. These methods are great because they abstract away most of the tedious work that comes with supporting cross browser compatibility, leaving us with a nice, consistent API.

Specifically, I’m going to show you examples of using addCssClass, getBounds, getLocation, and setLocation to accomplish a few client side UI tasks.

Click here to read the rest of this post »

Inline Edit Box .NET (v0.7)

AJAX, ASP.NET, JavaScript, UI By Dave Ward on October 30th, 2007

Mike’s been extremely busy this month, but found time to update Inline Edit Box .NET for us. Changes since version 0.5 include:

  • Added option for single click or double click (new Public Property called ClickMode: enum [SingleClick|DoubleClick])
  • Added ClientIDSuffix property to allow for repeater/web control objects.
  • Added Mode property. Allows to specify Admin or Display modes.
  • Fixed PostBack issues with regards to control properties.

Head over to the Inline Edit Box .NET page for the download link and more information.

Easy incremental status updates for long requests

AJAX, ASP.NET, JavaScript, UI By Dave Ward on October 3rd, 2007

Animation of the multi state progressA problem that has always plagued web developers has been providing detailed progress indication for server-side tasks. The stateless nature of the HTTP protocol makes implementing a mechanism for constant, stateful progress information cumbersome. The main problem is that a given group of server side tasks will generally only result in one, aggregate response from the server.

In the ASP.NET community, several solutions have been offered. Some even provide an entire framework for monitoring the status of tasks in progress. However, they are convoluted and depend on constant server polling. I find polling for progress indication to be an inefficient approximation, when exact data is readily available.

With that in mind, I’d like to share an alternate method that I’ve used in the past with great success.

Click here to read the rest of this post »

Seamless inline text editing: The Control!

AJAX, ASP.NET, UI By Dave Ward on September 17th, 2007

In my recent post, Seamless inline text editing with ASP.NET AJAX, I thought I had outlined the simplest possible way to implement the technique, but I was wrong. One of my readers, Mike Davis, took what I began and built it into the beginnings of a great ASP.NET server control.

The initial release is available here: Inline Edit Box .NET

With it, you can transparently implement the inline editable label functionality with only one line of code. He’s not finished refining it and adding new features yet, so he would like your input on where to go from here.

Download it, give it a try, and leave Mike some feedback in the comments on the download page today!

Seamless inline text editing with ASP.NET AJAX

AJAX, ASP.NET, JavaScript, Performance, UI By Dave Ward on August 23rd, 2007

Inline text editing animationThis is a technique that I really like. It’s excellently suited to intranet sites and administrative interfaces, where your users are typically familiar enough with the application to know which text they can click to edit. It’s actually very easy to implement, with a small amount of JavaScript.

Click here to read the rest of this post »