Friday, July 24, 2009

Getting Hand Dirty with ASP.NET 2.0

I am getting my hand dirty with the project work that I need to do for school. Its called Ambulance Dispatch System, trying to build it in .NET (ASP.NET 2005, web services). As usual, we started the project with 4 days left for submission.
I talked to a friend of mine and they told it took them a month to get the project done. I thought I can do this in 4 days :)

And here's how it all went.. Problems after problems after problems

--I hadn't touched ASP.NET and normal webpage stuffs since probably two years, we have been heavily using third party components (telerik, devexpress) and have been working on winforms and now on silverlight..


-- Get items on Postback?
So, I was recalling the whole concept of state management, getting items on postback, putting in viewstate etc. How do you get the item back when user submits the page.. How do we add validation on the page?


2. GridView... what if my collection is empty.. how to bind it?
So, I figured out, if the collection is empty, the gridview doesn't appear. You have to explicity either add an item to it -- (blank item) or do some hack around to get around it, just to show the header. This is what happens when you been using Telerik controls for ages.... Who cares about gridview ??

3. Google Maps integration
This will probably be another topic on how I tried to get this done, but in short, I tried to register it using the local ASP.NET site hosted as a filesystem, so everytime .NEt runs it, it hosts in a different port number like :http://localhost:2433/AmbulanceDispatch, and Google Map needs us to register a key to get it working for some domain (A particular domain site). So, I was forced to install IIS on my box and register the website as a webpage.

4. IIS
IIS cannot be installed as an installer. So, I had to go add/remove programs. Where's my windows CD now? Finally, I got that installed. Now setting up IIS. I get this funky error when I try http://localhost/AmbulanceDispatch.
I figured I had to install register .NET 2.0 with IIS (so i ran %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i) to get this done..
And then, I get another error

"Mutex could not be created"

--Fix, go and delete files for my website off C:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files.

So far, its been a day and half and I am done with one page.. lets see where I End up.

Imp to dos :
--Google API maps integration in different pages.
--Clean up UI.. DataLayer, Business Tier logic etc.

I still got 2 and half days.. :)