When an error isn't

Beacon Blog Article

By John Wallwork | Published December 20, 2008 | Categories: Web Development

For the past two weeks I've been working on a project that makes use of Microsoft's new AJAX controls for .Net.  These controls add a bit of snazziness to a website and help to increase usability and appearance.  With the completion of the User Interface data load, I turned my attention to fleshing out the action buttons on the screen.  That's when progress came to a screeching halt.  When clicking on a button (any button), a nasty .Net error message would appear.  This message was appearing before any of the pages code could execute on the postback.  After researching the error message on the web, I came to the conclusion that this was a known issue others had run into and that some people had some work arounds.  However the example code for the work arounds was in Visual C# and not in the visual basic that this project was using.   After several hours of migrating the code, I got a sample page that worked in the same manner   the projects page.  When I applied the new techniques to project page, the error still occurred.  This aroused my suspicions, so I did what doctor's do for surgery:  when in doubt: rip it out, thinking that maybe some portion of my code was blowing up the page. I began by removing all of my custom event processing code:  error still occurred.  I then removed all non useful HTML:  error still occurred.  Next went all of the .Net textbox, literals, combo boxes etc:  error still occurred.  When I finally got down to exact match to my working example:  the error still occurred.  Ah ha I thought, something has really snafued on the page.  So I deleted everything from the page, copied the example code over, and tested:  button click works, no error.  I started adding portions of my code back ( I had saved my original code before deleting code snippets), with each successive addition working fine.  When I had all my original code back, the page worked fine, no error.  So after a day of researching and coding my page, it was back to where I started.

The only explanation for original error kept seeing is this:  The page I was working on at some point had been saved as a Unix type file without the standard PC Carriage return/linefeed combo.  I believe this confused the IIS when it parsed the file resulting in the original error message.  When I copied the code, I saved it with notepad, thereby putting in the CR/LF's.  When the code was copied back, IIS could parse it correctly resulting in no error.

So after a day of research, recoding, testing.  I'm back to were I started know to try saving the file in notepad before I start fixing an error.

Let's get to work!

Contact Us