British Inside

An Englishman living in small town America

James Shaw

News

  • Copyright James Shaw 2004-2007

    Creative Commons License

    View James Shaw's profile on LinkedIn

ASP.NET 2.0 is magic..and not in a good way

Call me a control freak, but I really dislike the magical aspects of VS 2005 & ASP.NET 2.0. Angry

You know, the times where HAL VS2005 says "We'll fix that up for you, don't worry how".

Or "You don't have to write code, just give us a hint and we'll do all the work!".

Pfffffffffffffffft

The "project" debacle didn't help; the new magical "web app" and "web site" project types that do special things. Here's the thing - PROJECTS WEREN'T BROKEN.

But this magic is just for newbies, right? To make it easier for non-programmers to develop web sites using ASP.NET?

So tell me why I'm wasting hours of billable time today having to fix this magic when some code was moved from a web app to a normal assembly. Oh, sorry, that won't work - the magical "we'll fix that" pixie dust isn't there in the types of projects that we actually use.

(an example: I now have to go through and declare dozens of members in my codebehind that in a web app are magically defined)

Scott, I wish you'd listened when we all expressed our opinions on this. It really didn't work out you know.

Sing it together - remove the magic! kill declarative programming!


Posted: Wednesday, February 28, 2007 3:56 PM by James
Filed under: ,

Comments

Christopher said:

right click...convert to web app doesn't do this via partial classes for you? Still may have to do it dozens of times, tho.
# February 28, 2007 3:19 PM

James said:

perhaps it would, but i dont want to convert to a web app :D

# February 28, 2007 4:37 PM

Dan Hounshell said:

I love it when James gets pissed off and yells at people on his blog!!
# February 28, 2007 6:23 PM

Scottgu said:

There are two project systems fully supported in VS 2005 1) Web Site Projects 2) Web Application Projects If you don't like the web-site model, you should use the Web Application Project model. It provides the same model as VS 2003, but with a lot of improvements (no FPSE dependency, optional built-in web-server, better publishing support, etc). Both project-types are built-in with SP1. You can download the web application project model separately if you don't have SP1 installed. Full tutorials (including how to move from one project type to the other) can be found here: http://webproject.scottgu.com
# February 28, 2007 7:47 PM

Antogonist ;-P said:

"but i dont want to convert to a web app" A little less rant and a little more detail would help someone who understands these things better than you to help you out...
# March 1, 2007 6:48 AM

James said:

Antogonist- but ranting is sometimes needed. asking nicely unfortunately gets no response (everyones too busy).

but, i fixed the code, so I'll be happy to rant less and give more detail.

First, I'm moving code from project a to project b. I can change the structure or type of neither project.

in the original project there was an aspx file and an aspx.cs file - controls declared in the aspx were being used in the aspx.cs - but without being declared.

In project b that throws an error, namely "The name 'xxx' doesn't exist in the current context". I fxed it by going through all the errors and declaring the members in the codebehind.

Was there a better way?

# March 1, 2007 8:23 AM

Todd said:

So, to change the subject, when are you picking up the new sled?
# March 1, 2007 4:36 PM

James said:

lol, next saturday (3/10). flying in, driving back.

# March 1, 2007 6:40 PM

Antogonist said:

In one of the early betas of the new WAP, you had to do what you described, and I agree that it was a HUGE PITA. Now, with the latest bits, you should be able to right-click and choose "Convert to Web Application" at both the project level and the .aspx level to generate to proper partial classes for this model to work. Once you've done that, any edits to the .aspx file will cause the .designer partial class to be re-gen-ed for you. Admittedly, I have not tried the exact scenario you described, but the tutorial Scott mentioned should describe the process more clearly.
# March 2, 2007 2:24 AM
New Comments to this post are disabled