Compiled script and UI rocks

posted by Jeff | Thursday, January 31, 2008, 12:16 AM | comments: 0

I finished up some of those stupid forum tricks earlier tonight, and I can't say enough how much I love the fact that I can properly compile Javascript into library code that is dynamically linked to in a page. There's no complicated versioning, just upload the new assembly, and you're done.

In the old days, you had big old script libraries that you put pretty much everything in. There was no context to how they worked, or where, or when, but they were in every page. What's worse, you had to do a lot of stupid hacks to figure out how to have server-side code interact with it.

This ASP.NET AJAX framework is just rocking my world in those two respects. You've actually been able to embed resources in compiled assemblies for a long time, but the connection to the server end was always complex and without a standard. Now you write a little plumbing code, and the framework takes care of it. If the script is required, the script manager in the page knows to load it.

For example, I did a variation on autocomplete in the forum's private message page. When you type a few letters, it fills a dropdown list with likely choices of members you want to write to. One of the configurable options is the number of characters before it delivers results. Setting that property on the server control is like any other control, but when the client-side part is written correctly, it's persisted there easily for use.

Great stuff. Now that I finally understand it, I really like using it.


Comments

No comments yet.


Post your comment: