Archive for October, 2006

Ten Essential Tools: Visual Studio Add-Ins

While looking for some cut and paste utilities for Visual Studios I found this great MSDN Magazine Article. 

Ten Essential Tools
Visual Studio Add-Ins Every Developer Should Download Now
James Avery

TestDriven.NET
GhostDoc
Smart Paster
CodeKeep
PInvoke.NET
VSWindowManager PowerToy
WSContractFirst
VSMouseBindings
CopySourceAsHTML
Cache Visualizer
Wrapping It Up

Get the article at the link below:

Ten Essential Tools: Visual Studio Add-Ins Every Developer Should Download Now — MSDN Magazine, December 2005.

Change the View Source Editor in Internet Explorer

It’s great that NotePad is there on any machine that you step up to, but doing as many demos as I do I often want to do a “View Source” to show folks what’s going on in the code.

I also like to be able to change the editor depending on what I’m working on. If I’m working with types I want to “view source” in TopStyle, if it’s HTML then maybe NVU or HTML-Kit, JavaScript….  I’m still trying out JavaScript editors.

But, it’s a pain in the neck to have to hack the registry for each time I want to make that change.

Here is a cool utility that I found to make it easy.

Get it HERE : View Source Editor, the easy way to change the editor in Internet Explorer

SQL Server Hosting Toolkit

Getting your database deployed :

The Database Publishing Wizard enables the deployment of SQL Server 2005 databases into a hosted environment on either a SQL Server 2000 or 2005 server. It generates a SQL script file which can be used to recreate the database in shared hosting environments where the only connectivity to a server is through a web-based control panel with a scripting window.

Get it HERE : SQL Server Hosting Toolkit

John Lam (The RubyCLR Guy) Joins Microsoft

John Says…

“I’ve decided to stage a friendly takeover of Microsoft. As of January, 2007 my new work address will be Building 42 at Microsoft. I’ll be working in the CLR team to help bring the love of dynamic languages out to the statically typed heathens :)”

Check his post out at:

http://www.iunknown.com/articles/2006/10/20/dynamic-languages-microsoft-and-me

Animated .GIFs for your UpdateProgress Control

MS AJAX developers need to be able to tell their users when the browser is waiting for a response from a network call.

Usually the text message is accompanied an animated .GIF

Here is a cool web site that lets you just choose your color scheme and pick one of the 10 different types of .GIFs that are available.

Check is out here:

http://www.ajaxload.info/

Reset the MS AJAX TimerControl’s countdown.

Are you using a MS AJAX timer control to auto refresh content on your page but want to reset the timer when a user action forces a refresh. In your server side code you can reset the timer by adding two lines like this: Protected Sub ButtonResetTimer_Click(ByVal sender As Object, ByVal e As System.EventArgs) TimerControl1.Enabled = False TimerControl1.Enabled = False End Sub

Does your MS AJAX Popup FLASH ?

When you are using an MS Ajax popup that is not displayed by default, are you seeing yor popup FLASH for a second when the page loads ?Try this. Define CSS classes for the item to be poped up. Make sure the default CSS class has a visibility:hidden attribute. Like this…….

Then, use classes like this. Default: The “FLASH” goes away.

Port80 Software, a Microsoft partner, has released a new survey showing that the Microsoft Internet Information Services 6 Web server has overtaken the Apache open-source Web server among Fortune 1000 Web sites.

In the survey released on Oct. 11, Port80 Software said IIS 6 more than doubled its market share over the last year, to 27 percent. However, IIS 5 remains the most popular Web server among Fortune 1000 users, according to the survey.

http://www.eweek.com/article2/0,1895,2029153,00.asp

Official ATLAS BETA Announcement

From ScottGu’s blog.

ASP.NET AJAX Beta 1 Released

Last month I posted about the official new name for “Atlas,” and discussed the roadmap plan for shipping a free, fully-supported, v1.0 release that works on top of ASP.NET 2.0 and Visual Studio 2005.

Today I am very pleased to announce the first official Beta release of Microsoft ASP.NET AJAX v1.0. You can download it now from the http://ajax.asp.net site. Available on the site are three download options:

1) The ASP.NET AJAX v1.0 “Core” download. This redist contains the features that will be fully supported by Microsoft Product Support, and which will have a standard 10 year Microsoft support license (24 hours a day, 7 days a week, 365 days a year). The download includes support for the core AJAX type-system, networking stack, component model, extender base classes, and the server-side functionality to integrate within ASP.NET (including the super-popular ScriptManager, UpdatePanel, and Timer controls).

2) The ASP.NET AJAX “Value-Add” CTP download. This redist contains the additional higher-level features that were in previous CTPs of “Atlas,” but which won’t be in the fully-supported 1.0 “core” redist. These features will continue to be community supported as we refine them further and incorporate more feedback. Over time we’ll continue to move features into the “core” download as we finalize features in this value-add package more.

3) The ASP.NET AJAX Control Toolkit. This project contains 28 free, really cool, AJAX-enabled controls that are built on top of the ASP.NET AJAX 1.0 “Core” download. The project is collaborative shared source and built by a combination of Microsoft and non-Microsoft developers, and you can join the community or just download it on CodePlex today.

Some of the Changes with the Beta

There are a number of changes that the team has made with this beta release. A few of the significant changes include:

Performance and Download Size Optimizations

Previous ASP.NET AJAX CTPs relied on the browser downloading a single large, JavaScript file to the browser that contained all of the features. With this Beta release we have spent a lot of time on factoring out features into multiple files (so you don’t have to download them unless you use them), and in optimizing the bandwidth size of the overall library. The ASP.NET AJAX “Core” download now includes two JavaScript libraries that are used to support all of its features:

a) The MicrosoftAjax.js.gz script file contains the core JavaScript type-system, component/control model, JSON networking/serialization stack, and application-serviceas features (Profile + Authentication). It is now 14.8k in size.

b) The MicrosoftAjaxWebForms.js.gz script file then adds the support to enable UpdatePanel scenarios and partial page rendering. It is 6.4k in size.

These files are only downloaded by a browser once when visiting a site — they are then cached on the client and reused across all pages and repeat visits. The new size targets should ensure a snappy and speedy experience the first time you hit a site.

In addition to optimizing the initial download size of the JavaScript libraries, we have spent time optimizing the network traffic size of client JavaScript callbacks to the server. Controls like the UpdatePanel, UpdateProgress, and Control Toolkit controls no longer emit xml-script by default, and instead just emit 1-2 lines of JavaScript (which can help significantly reduce the network traffic size on the wire).

We have also moved from using JavaScript closure-based classes to using prototype-defined classes in the core type system, which we’ve found reduces memory usage for most common application scenarios.

Safari Browser Support

Previous ASP.NET AJAX CTPs didn’t have great support for Safari (UpdatePanel didn’t work at all). With this Beta we have added Safari as a fully tested and supported browser.  We are currently working on adding Opera support as well – although we aren’t ready yet to call it supported with this build (stay tuned for updates).

Significantly Better Debugging Support

As anyone who has spent a lot of time doing it can attest, debugging JavaScript is often not a lot of fun. We’ve made two significant changes with this Beta that will help improve the debugging experience with the Microsoft AJAX Library considerably:

1) By moving our JavaScript class definitions from being closure-based to prototype-based, you can now use the existing Visual Studio 2005 script debugger (and/or other existing JavaScript debuggers) to better inspect and step through JavaScript objects. Closures previously hid a lot of inspection information.

2) We invested a lot of time putting together an automated JavaScript build environment that enables us to produce two versions of all of our JavaScript files: a retail version that is optimized for performance and download size, and a fully instrumented debug version that is optimized for helping you catch issues with your code during development. Every function within the debug version of our script files now includes parameter and argument validation code that verifies that the function is being passed the correct arguments before running, and that will assert with stack trace information if not. This can help to more easily pinpoint errors with your JavaScript code early, and hopefully significantly improve JavaScript debugging.

Note: By default, the decision to use the retail vs. debug versions of the AJAX script libraries is driven by the <compilation debug=”true|false” /> setting within your web.config file. Because this client-side parameter validation code significantly increases the size and performance overhead of the client-libraries, make sure you set debug=”false” before deploying any application (for more reasons on why you should always set debug=”false” when deploying ASP.NET applications, please read this past post of mine).

Another Note: Our plan is to have the next version of Visual Studio use the same argument validation metadata that we use at runtime with debug scripts to also drive IntelliSense and syntax checking of JavaScript within the IDE. You can add this metadata to your code to improve validation, error checking, and eventually IntelliSense of your own JavaScript libraries as well.

UpdatePanel Improvements

The UpdatePanel control have been updated significantly with this Beta release to incorporate customer feedback. In addition to adding Safari browser support, the UpdatePanel control now has new support with this Beta for:

a) Client-side script event hooks to let you write client-side JavaScript to more easily participate in callbacks.

b) The ability to contain controls within an UpdatePanel that trigger both partial-page postbacks as well as normal postbacks (you now get to choose depending on your scenario). You can also now disabled child controls from causing UpdatePanel postbacks at all.

c) The ability to use ASP.NET validation and Wizard controls within UpdatePanel controls (there were some bugs that prevented this before).

d) The ability to dynamically create and add UpdatePanel controls into a page, rather than having to statically define them. This is particularly useful for control developers who can now instantiate and use UpdatePanel controls within their composite controls.

e) The ability to have multiple UpdateProgress and Animation controls on a page that can run conditionally based on which UpdatePanel callback is occurring.

f) The ability to declaratively specify how long to wait before an UpdateProgress control should become visible. This enables you to avoid showing progress status for quick UpdatePanel callbacks.

g) Support for screen readers and other accessibility tools with UpdatePanel scenarios to better implement Section 508 standards.

Important Beta Note: the UpdateProgress control with the Beta is currently shipping in the “Value-Add” download, so you will need to add this to your site in order to use it.  With the next beta refresh it will be moved to the “core” download, and will be a fully supported scenario. 

Lots of Improvements in the Client Script Library Stack

We’ve incorporated a lot of customer feedback and cleaned up, simplified, and enhanced a lot of the client-side JavaScript library APIs. In addition to moving from closures to prototypes, a number of other API cleanup changes have been made including:

a) Simpler client JavaScript event model. It is now easier to define and attach events on the client. Object events are also now created on demand to reduce startup time and the size of the working set.

b) Simpler Component, Behavior, and Control types. APIs can now be used without first needing to instantiate their related objects, and on-demand semantics have been added to improve performance.

c) Client networking improvements. Default callback functions and method-name semantics provide a much easier way to perform common asynchronous callbacks.

d) Membership and Profile APIs. Simpler APIs for interacting with the Membership and Profile APIs from client-side JavaScript are now supported.

Better Compatibility with other AJAX Libraries

One challenge with JavaScript is that collisions between different client-side JavaScript libraries can be ugly. Previous ASP.NET AJAX CTPs defined a global helper function named $( ) that conflicted with other common JavaScript libraries (including Prototype and Scriptaculus).

With this Beta we have renamed our $( ) function to $get( ) and made a few other naming changes to help enable multiple independent AJAX libraries to play nicely together on the same page.

Source Modification License

One common request we have received is the ability for developers to make source modifications to the core Microsoft AJAX JavaScript library (to add a small feature, tweak an implementation, or make a tactical bug fix).

We are going to provide a license to explicitly allow custom modification of the libraries, and the ScriptManager API that ships with this Beta now allows you to provide alternative implementations/tweaks of the built-in JavaScript libraries. In addition to allowing you to tweak the libraries for your own applications, the license will also grant redistribution rights so that you can ship them with your own components and extensions. (The one requirement for redistributing your own custom version is that you need to change the namespace to avoid conflicts.)

We think the combination of having both full enterprise-level support (with 10-year support services), along with modification redistribution rights is a really powerful offereing that will provide developers with a ton of flexibility regardless of their project type, size, or target audience.

Next Steps

As you probably noticed from the paragraphs above, there are a number of new features and changes with this Beta. Existing ASP.NET AJAX code will need to be updated to reflect these changes.

If you have been using server-side ASP.NET AJAX features, you should find the updates relatively straightforward. These will mostly involve renaming the control prefix from <atlas:> to <asp:>, modifying the trigger syntax for UpdatePanel controls, and making small syntax changes to how extender controls in the Control Toolkit are declared.  You can read a migration guide with the details on how to-do this here.

If you have created your own JavaScript class types and, or if you interact with the component model directly, you will need to make more significant changes. What we’ve found when updating samples is that the JavaScript changes are not too complicated by themselves – what is frustrating is that JavaScript’s type-less flexibility prevents tool compilation checking, and forces you to update things iteratively to find and fix each change, which can be tedious and annoying. To help with migration from the CTP to the Beta, the ASP.NET AJAX Team has published a detailed document listing the specific changes that have been made and which includes code samples that show before and after versions of common patterns and APIs usages. We will be publishing this document shortly here.

The ASP.NET AJAX team will also be monitoring the forums closely over the next few weeks to help people with migration questions and any issues they find. Please post in the forums to get help if you run into any issues, find any bugs, or need any help.

We are really looking forward to having lots of people use the Beta and to getting more feedback. We believe the API definitions for the features currently in the ASP.NET AJAX v1.0 Core download are now pretty close to being final, and our plan for the rest of this year will be to keep taking feedback and bug reports, and stabilize and lock down the release. Our plan is to release a beta refresh in a few weeks that incorporates customer feedback, then ship a RC release after that, and then ship it as a fully supported 1.0 release once people feel it is ready.