How I Got Started in Software Development

General By Dave Ward on July 1st, 2008

Well, Justin Etheredge tagged me in Michael Eaton’s software development meme that’s been going around.

As far as blog-chain-letters go, this is a great one. It’s interesting to see how many diverse backgrounds lead us in the same direction.

Click here to read the rest of this post »

PostBack Ritalin Updated (v0.10)

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

After a long beta period, PostBack Ritalin v0.10 is finally ready for release. This is absolutely the best version yet. Many edge case issues have been resolved, and the code is leaner and more efficient than ever before.

Changes include:

  • Complete rewrite of the JavaScript component of the control. Instead of global variables and functions, PostBack Ritalin is now a proper JavaScript object. This significantly minimizes its namespace impact on the DOM.
  • JavaScript embed is now minified.
  • By popular demand, added support for disabling LinkButtons.
  • Added optional image pre-loading for WaitImages. Previously, disabled ImageButtons could take a bit too long to show their disabled image the first time, due to HTTP delay. Enabling pre-loading will cause the browser to pre-fetch and cache the disabled images, resulting in instant feedback for the disabled state.
  • Several bug fixes, thanks to your invaluable feedback.

I’m especially happy with the JavaScript rewrite. Using the object oriented approach on the client side, I’ve added the beginnings of a client-side API similar to the AJAX Toolkit controls (get_property, set_property, etc). Currently, this won’t be of much use to you, but I’ll be expanding and documenting the client-side API in future versions.

The one feature that I wasn’t able to add yet is support for disabling all buttons on the page or within the triggering container. Considering the sweeping changes to the entire client-side portion of the control, I decided to avoid adding significantly more complexity to it in the same release.

I haven’t forgotten about it though, and will add the feature soon.

As always, the free download is available on the PostBack Ritalin project page.

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 »

Inline Edit Box on CodePlex and new PostBack Ritalin beta

AJAX, ASP.NET, PostBack Ritalin, UI By Dave Ward on May 16th, 2008

I’ve decided to open source Mike Davis’ ever-popular Inline Edit Box .NET control. Neither of us have enough time to maintain it properly, and several of you have expressed interest in contributing if it were open source. So, its new home is CodePlex: http://www.codeplex.com/InlineEditBox

You’ll have to bear with me, because this is my first CodePlex project and I’m still familiarizing myself with the admin functionality of the site. If you have any trouble contributing to the project, contact me directly and I’ll do my best to resolve it quickly.

Click here to read the rest of this post »

Highslide JS .NET Updated (v0.7)

AJAX, ASP.NET, Highslide, UI By Dave Ward on April 29th, 2008

An update to Highslide JS .NET is available today. I recommend that everyone upgrade, to benefit from the memory leak fixes in the latest Highslide JS.

v0.7 (4/29/2008)

  • Updated embedded Highslide version to 3.3.17.
  • Improved caption rendering, using inline caption divs. This should result in more semantic markup, pairing your captions with your images.
  • Added HighslideManager property: NumberOfImagesToPreload. This allows you to control how many images are automatically preloaded.
  • Added HighslideManager property: FadeInOut. When true, this fades the enlargement in and out as it’s resizing.
  • Added HighslideManager property: RenderScriptInPlace. This allows you to control where on the page the Highslide JS script is inserted in your page.
  • Updated download to include a sample site, to make it a little easier to get up and running quickly.

As always, the latest version is available on the Highslide JS .NET project page.

Why you should not place your whole site in an UpdatePanel

AJAX, ASP.NET, Performance, UI By Dave Ward on April 23rd, 2008

Perhaps due to its ubiquitous presence in web based email services, implementing asynchronous site navigation is frequently a design requirement when building AJAX based sites. Unfortunately, the also ubiquitous UpdatePanel is chosen to accomplish this far too often.

I’d like to take a moment to strongly recommend against doing that.

I’m going to explain what I believe are the three most dangerous drawbacks inherent to UpdatePanel based navigation: Performance degradation, usability concerns, and lack of maintainability.

Click here to read the rest of this post »

Why do ASP.NET AJAX page methods have to be static?

AJAX, ASP.NET, OO By Dave Ward on April 16th, 2008

Image of a spark (static).Dozens of variations on the title of this post are some of the most common searches that bring people here to Encosia. Unfortunately, the search engines all point to a post that doesn’t answer the question. It’s also a frequent question raised on the ASP.NET message boards, typically without a satisfactory answer provided.

However, it is an important question, the answer to which is important to understand. So, in an attempt to fill in this gap for the searchers and perhaps preemptively help others, I want to proceed to answer it as thoroughly as possible without overly complicating the whole business.

In order to do this, we’ll have to take a brief tour of WebForms, including:

  • Understanding what the Page class is, and why we have it.
  • One specific thing that the Page class does for us.
  • How this is accomplished, behind the scenes.
  • What the static keyword entails, when used with a method.
  • Finally, why page methods must be static.

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 »