Alt.NET Podcast – jQuery in ASP.NET

AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on October 10th, 2008

If you’re reading this, you probably already know that I’m a big fan of integrating jQuery with ASP.NET. If you’re of the same mind, you’re sure to enjoy the latest Alt.NET Podcast: jQuery in ASP.NET.

Update: Part two of our discussion on jQuery and ASP.NET.

Mike Moore hosted a roundtable discussion on the topic, between Bertrand Le Roy, Chris Brandsma, Rick Strahl, Steven Harman, Scott Koon, and myself. Between us all, the discussion ranges from the official Microsoft viewpoint, to theory about JavaScript and jQuery, to the pragmatic.

Whether you’re already on board with jQuery + ASP.NET integration or you’re still trying to figure out what the announcement means for you, I think you’ll find the discussion interesting. I know I did!

Review: Advanced ASP.NET AJAX Server Controls

AJAX, ASP.NET, JavaScript, Reading By Dave Ward on September 3rd, 2008

The most common complaint I typically have with the ASP.NET AJAX books I review is that they simply don’t cover JavaScript in enough detail. JavaScript represents half of the nouns in the AJAX acronym, and all of those relevant to ASP.NET AJAX.

For that reason, when I read a book that only contains a few pages about remedial JavaScript and then jumps directly into using UpdatePanels and Timers, I don’t recommend it to you.

However, I was very impressed when I began reading Adam Calderon and Joel Rumerman’s recent book, Advanced ASP.NET AJAX Server Controls.

Click here to read the rest of this post »

Easily build powerful client-side AJAX paging, using jQuery

AJAX, ASP.NET, JavaScript, UI, jQuery By Dave Ward on August 20th, 2008

A book's pages blowing in the wind

When I suggest that developers consider using web services and a more client-centric approach to solve their UpdatePanel performance problems, the lack of paging is often their first objection.

Conventional ASP.NET wisdom seems to hold that the GridView/UpdatePanel combo is king when asynchronously paging through a data source. If you’ll give me a few minutes of your time, I’d like to challenge that notion!

Click here to read the rest of this post »

It’s almost that (book giveaway) time again

AJAX, ASP.NET, JavaScript, Reading By Dave Ward on August 18th, 2008

When I heard the banging on my front door early this morning, I thought it was yet another solicitor selling magazine subscriptions or overpriced vacuum cleaners.

That periodic interruption ranks near the top of my short list of telecommuting drawbacks. It’s truly amazing what gall door-to-door solicitors have, even in the face of the NO SOLICITING sign prominently displayed on the only street into my neighborhood.

Click here to read the rest of this post »

A sneak peak at ASP.NET AJAX 4.0’s client-side templating

AJAX, ASP.NET, JavaScript, UI By Dave Ward on July 23rd, 2008

Hot on the heels of the recent ASP.NET AJAX roadmap, Bertrand and team have released a limited preview of the new AJAX functionality coming in ASP.NET 4.0.

To see how the new functionality stacks up, I decided to recreate my recent jTemplates example, using only ASP.NET AJAX and its new templating features. Eventually, I settled on using the DataView class, which offers more advanced, repeater-like functionality.

Having successfully completed the exercise, I thought it seemed like something that you might find interesting too. The solution boils down to four easy steps:

  • Creating a page method to return JSON data.
  • Setting up a ScriptManager to coordinate script and page method access.
  • Defining the client-side template that will render the JSON data.
  • Using JavaScript to render the template, using the page method’s return.

Click here to read the rest of this post »

Use jQuery and ASP.NET AJAX to build a client side Repeater

AJAX, ASP.NET, JavaScript, UI, jQuery By Dave Ward on June 26th, 2008

There was some interesting discussion on Matt Berseth’s blog recently, regarding methods for building and displaying markup on the client side. Though I haven’t posted any examples here before, rendering markup on the client is a technique that I use often and recommend.

By sending only data to the client, you can profoundly reduce the size of what you send and see a substantial increase in performance. You also allow yourself the ability to easily add features like light-weight sorting and paging on the client. This can not only improve your users’ experience, but reduce server load and bandwidth requirements.

To that end, I’m going to walk you through these four steps to effectively implementing a client side Repeater, using ASP.NET AJAX and jQuery:

  • Create an RSS Reader page method to return JSON data to the client.
  • Call that page method with jQuery.
  • Use the returned data to build a table on the client side.
  • Improve upon the table creation with a templating plugin.

Click here to read the rest of this post »

3 mistakes to avoid when using jQuery with ASP.NET AJAX

AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on June 5th, 2008

Over the past few weeks, I think I have definitely embodied Jeff Atwood’s claim that we’re all amateurs, learning together. Despite my best efforts to thoroughly test before posting, a few problems slipped through in my recent posts about using jQuery to consume ASP.NET JSON serialized web services and using jQuery to call ASP.NET AJAX page methods.

On the bright side, your great feedback in both posts’ comments has reinforced the fact that some of the best content on my blog is the part that you write.

In this post, I’m going to detail three of the problems that were discovered as a result of those previous two posts:

  • An extra requirement when making a read-only request to IIS6+.
  • An oddity in Internet Explorer 7’s XmlHttpRequest class.
  • A common mistake when passing JSON parameters through jQuery.

Finally, I’ll suggest what I now believe to be a best practice usage, taking all of these issues into account.

Click here to read the rest of this post »

Using jQuery to directly call ASP.NET AJAX page methods

AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on May 29th, 2008

When it comes to lightweight client-side communication, I’ve noticed that many of you prefer ASP.NET AJAX’s page methods to full ASMX web services. In fact, page methods came up in the very first comment on my article about using jQuery to consume ASMX web services.

Given their popularity, I’d like to give them their due attention. As a result of Justin’s question in those comments, I discovered that you can call page methods via jQuery. In fact, it turns out that you can even do it without involving the ScriptManager at all.

In this post, I will clarify exactly what is and isn’t necessary in order to use page methods. Then, I’ll show you how to use jQuery to call a page method without using the ScriptManager.

Click here to read the rest of this post »

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 »