A Day In The Life Of An ASP.NET Developer

I've been busy all day long and it is sometimes interesting to read about a day in the life of a professional. I learned a lot of new things today in the course of my work. Since it was the end of the month, I totaled up my hours and sent a client an invoice. I should probably do something to make this less of a chore. Preparing an invoice means copying all my activities from a list I keep in a notebook into a table in a web page. Then I have to add up the hours which aren't totaled automatically in a web page. We used a Quickbooks Timer in my old job but it was a funky DOS application that kept crashing. 

  The first thing I wanted to do today was to make some progress on a project migrating an ASP web application to ASP.NET 2.0. There are some things about this ASP web application that warrant a migration. It is extremely difficult to troubleshoot because there are some occasional SQL syntax errors. Unfortunately ASP has very limited error handling capabilities so I would like to move to ASP.NET 2.0 which will make it easier to instrument the code. Also the client side code attempts to load too much data into JavaScript arrays and this is bogging down the browser. I think some modern AJAX code would help with that problem. There have also been many session expiration and performance problems which I hope to solve.

When I attempted to load the web application in my browser I got a web.config error I've never seen before: Unrecognized attribute 'type'. I wonder if this was caused by my recent install of ASP.NET 3.5? In any event, it turned out that the web application mysteriously converted to ASP.NET 1.1 in Internet Information Server so I had to change it back to ASP.NET 2.0. I added this error and its solution to my notes on ASP.NET 2.0 problems. I also noticed that my web.config file was still using 3.5.0.0 assemblies as generated by Visual Studio 2008 Beta 2 even though I've been working on this project in Visual Studio 2005. I have not used any ASP.NET 3.5 features yet so I can still use Visual Studio 2005 for the development work. It does not appear to cause any problems if you are not doing anything that Visual Studio 2005 would not know about. NOTE: The client actually wants to migrate to ASP.NET 3.5 so this web application won't be using old technology anymore.

My goal was to complete just one page in an hour but it took longer than that. First I copied a SQL query from the old ASP page and ran it in SQL Query Analyzer. Then I added some columns using a join in preparation for a GridView control. I used this query in the DataSet Designer to create a new TableAdapter. Next I added the GridView control to my ASP.NET page. I struggled to configure the columns to match the original table design and then I decided it would be easier to adjust my query. So I rewrote my SQL statement using some string concatenation and column name aliases to make my job easier. I was unable to concatenate an integer to a string so I had to look up the CONVERT function syntax. Then I had to regenerate my TableAdapter and refresh the GridView columns.

The first column needed to contain a radio button. This page is intended to allow you to select a column and then click a button to create an Excel spreadsheet for that record. Fortunately, I found a tutorial on Adding a GridView Column of Radio Buttons. I also had another column that required an ItemTemplate because it uses two different ID numbers. I used cross-page posting for the button because I already had the Excel code written. In fact, the ASP site is now using an ASP.NET 1.1 page to generate the Excel spreadsheet because it needed to be rewritten and the client does not want any more ASP code maintenance done. The original ASP page just posts to the ASP.NET page which has all its code in a script block, i.e. no code behind file. A postback would have been out of the question anyway because the content type needs to be changed for Excel.

All that work ate up 5 hours of my day because the radio buttons were a bit tricky. I added a new topic to my notes on using radio buttons in a GridView control because this project will need that on many pages. I noticed that I kept getting an annoying JavaScript error on many web sites so I decided to investigate that. The error was "A Runtime Error has occured. Line: 1. Error: Invalid character".  I even get that pesky JavaScript error on http://weblogs.asp.net/ and was considering jeering about the bad coding but I saw the exact same error on many other sites so I suspected it was not a problem with the web site. I found a lengthy newsgroup posting about this problem and eventually managed to solve it by disabling third party browser extensions. I may have picked up some Hijackware somehow.

I came across a web page about some obscure HTML table tag attributes, frames and rules. I thought I knew everything about tables so it annoyed me to discover something new about tables. I think I've seen lhs (left hand side) somewhere and was mystified about it so I added this information to my notes on HTML tables. This is a web page in my custom help collection with some useful information on using THEAD and TBODY to get table headers printed on every page of a web page print out, and the CSS to style a table in the format I prefer.

While I was adding stuff to my notes I decided to document how to set the text for a RadioButtonList control's ListItems. A few days ago I had to add some names from a database to the radio button text and it took me quite awhile to figure out how to do that. You just set the asp:RadioButtonList's Items collection text properties like so:

rblFruit.Items(0).Text = objReader("Qty") & " apples"
rblFruit.Items(1).Text = objReader("Qty") & " oranges"
rblFruit.Items(2).Text = objReader("Qty") & " pears"

After adding that much information to my notes I decided to recompile my custom help collection. It now contains 1076 topics which means I have 1076 web pages compiled into it! I've been keeping notes for 9 years. I timed the recompile and it took 11 minutes for this project to compile. I don't even try to load it in Visual Studio 2003 anymore because it chokes on it. I just edit my project files in a text editor and do command line builds. After the recompile it took 9.5 minutes for the help collection to update itself for new content. That is 20 minutes just to update my notes!

Well that is all I managed to do today. I watched a few YouTube videos inbetween tasks so I would not get too bored. I found a few YouTube videos on Visual Studio 2008.

1 Comment

Comments have been disabled for this content.