Pages

Tuesday, September 23, 2008

Global.asax and single page assemblies

After a comment from reader, I decided to post a small update before the release of my web application project V2. This version basically the same code that i have released before on my blog about web application project now ... working. In this new version I have added the global.asax file and got it to work on the single assembly model.

It all comes down to the mix and mash compilation of the web application projects trying to be to many things at once. The global.asax file will work out of the box however if you are trying to use single page assemblies model with it (keeping all files the same format ie using code file instead of code behind attribute) you need to change a few things with the global assembly file before it all works.

Firstly you must change the code behind attribute int he global.asax file to code file. Notice that the schema will show a validation error telling you that code file is not supported, ignore that, the code file as shown in the .net documentation is the replacement for code behind attribute and it is supported by the compiler. (see url: @ Application - Global.asax)

After that you need to go the the global.asax.cs file (ie the code file) and add the keyword partial to the Global class, that will allow the file to be merged into one class.

The last thing that you need to do is to change the build action on the code file to none so the compiler wont compile the class twice. After all of that we should be ok. Build and you will see your single assembly for your global.asax file.

Enjoy

Daniel Portella

You can download the code for this post below.

Wednesday, September 3, 2008

Google Chrome

Just as note, having installed Chromo I must say it is the best browser I have used so far, the speed in which it rends pages is just awesome.

I urge all of you to give it try.

On another note, there is a possibility that I might do sort presentation (5 minutes) in the uk remix event in Brighton as part of competition organized by nxt gen ug (Next Generation User Group). Lets hope I can get a place.

I know it has been a while since I posted about some technical thing. well I currently playing Sp1 for 2008 and I will be posting a new web application project here so you can use it with web deployment project with out problems (It was requested by some users).

Ok people enjoy your day and dont eat to much is not good to overdue it.

Regards

Dan

http://dmportella.blogspot.com - This posting is provided "AS IS" with no warranties, and confers no rights.