April 2003 - Posts

JavaScript Debugging

I've recently been asked to review a few of the ASP.NET 3rd party controls that provide the very rich client-side user experience. One such control is Infragistic's UltraWebGrid2. While this control is really quite nice, there is the need to include some of your own JavaScript to utilize the control to its fullest extent. In this process I was reminded why I stopped working on web front-ends a few years before ASP.NET: the frustration of trying to debug JavaScript.
 
But now -- WOW -- Visual Studio.NET comes thru with flying colors. Just two simple steps to client-side debugging nirvana.
  1. Clear the "disable script debugging" checkbox in Internet Explorer's advanced properties.
  2. Add the keyword "debugger" somewhere within your JavaScript.
When you run the web page from Visual Studio in debugging mode, viola--when it hits the "debugger" statement, the Visual Studio debugger window takes control, you can set your break points, and proceed as normal. You can even get very clever setting the "debugger" from within script created from you server-side code that's registered with one of the many "Register" client-side script block methods.
Posted by shark with 12 comment(s)

A Ghostly Experience

A few days ago I began hearing the death rattle clicking sound of a dying disk drive. Sure enough, the event log verified several retry attempts on the drive. As a veteran of the operating system wars, I've always maintained that is was easier to reinstall the OS and all applications from scratch (following a disk format), rather than trying to recover from a disaster. I maintain all data backups, and I've done this many times in the past.

But to prove that this old dog can learn something new, I decided to attempt a recovery using Symantec's Norton Ghost. I borrowed a friend's external USB drive to aid in the transfer and purchased a replacement for the ailing disk. I can honestly say I've never seen a commercial package that is less intuitive to use, and more poorly documented than Norton Ghost. While the USB drive worked fine with the OS, it was not recognized by the Ghost loader. Neither did attempts to Ghost using the local network ever yield success. But eventually I discovered I could simply add the new disk to the existing workstation as a secondary drive and Ghost to it directly. This may be obvious to others; but, it took me several hours of investigating alternatives before figuring it out. From past experiences with tools of this type, I thought I first needed to create an "image" file of some sort on some other media.

The bottom line is I now have a new (faster) hard disk on my development workstation, and it seems to be working fine. By Ghosting, I probably saved myself a full day of reloading software. Unfortunately, I took me almost a full day to learn how to Ghost. But I'll be ready the next time.

Posted by shark with 1 comment(s)

Another Hidden Jewel--System.Windows.Forms.PropertyGrid

I was just writing my 10-millionth option settings dialog for a WinForm application when I discovered the wonderous PropertyGrid. We've all used this control within Visual Studio to set the properties of controls and other aspects of our project. I just didn't know it was a control we could add to our toolbox and, voila-instant object property settings--presented in a very consistant manner.

The key method of the PropertyGrid class is SelectedObject, which sets the object for which you wish to view/set its properties. A great little sample is a hello-world WinForm application that contains the PropertyGrid in the main form. Set the grid's SelectedObjet=this (the form itself) and you see all of the forms public properties. Be careful not to set Enabled=false--you'll be unable to continue since your main form is no longer enabled.

I don't remember discovering so many useful widgets when I worked with MFC/C++ for so many years--another testimony to the richness of the Framework classes.

Posted by shark with 1 comment(s)

ASP.NET FTP Tool - CultureInfo

The beta testing of the ASP.NET FTP Deployment Tool continues with mostly success stories being reported. I did have an interesting report this morning from someone running with their machine's culture set to "Dutch". The application failed almost immediately as a result of a DateTime.Parse assuming US-eng. The individual reporting the problem let me know that this was a common issue with software that is downloaded.

I have to admit that I didn't even consider CultureInfo in this WinForm application, although I've dealt with some internationalization issues in web applications. One more issue to consider when using the Internet to distribute our thoughts, ideas and products.

Posted by shark with 1 comment(s)
More Posts