Welcome! and rules
Joel on Software
Taking control of ASP .NET
Thursday, June 9, 2005
I know what you mean, all those "Teach yourself ASP.NET in 24 seconds" books miss the point really.
I use ASP.NET in VS.NET all day, every day and I have found that the best way to handle this is to have an essentially blank .aspx page and then override the Page methods in the code-behind page.
Then you can do just what you like, without all the extra twiddly bits getting in the way.
Here is the "HTML" view of the main page in the current web-application I'm working on:
Obviously, the XyzPage class (which inherits from System.Web.UI.Page) does all the work, by overriding OnInit, OnLoad, Render, OnUnload, etc.
In my case, the structure of the page (i.e. which controls go where, data-binding rules, etc) is definied in a database. This data is fetched as the page is created and the resulting HTML, etc is rendered to the browser (in the Render override). This means that you only need one .aspx page (see above), which can "behave" as any of the thousands of possible pages in the system.
I really didn't want to have to create the 2000+ pages for this system, so I created just one generic one and stored the definition in the database. This has numerous advantages, including the fact that maintenance is trivial (well not really, but compared to keeping track of 2000 pages it is).
Of course, it depends what kind of thing you're working on. If you want a quick and dirty solution, then by all means do the drag-and-drop thing. But for me, I abandoned that after one day, in favour of being in control.
BTW, I love your analogy about wanting a fast car, not a rocket ;-)
Thursday, June 09, 2005
Thursday, June 9, 2005
I strongly encourage you to get a copy of Fritz Onion's book "Essential ASP.NET". It's the best second book you can possibly have on ASP.NET, and goes into lots of detail on the HTTP pipeline, what happens in page processing, and all the hooks you can use to take control of stuff.
aspx pages are only the very tip of the iceberg in ASP.NET.
Friday, June 10, 2005
Just had the chance to put my hands on Fritz Onion's book and read the 1st chapter which, alone, it's worth the price of the book!
Thanks both for your replies
Monday, June 13, 2005
Fog Creek Home