bri189a Posted June 13, 2005 Posted June 13, 2005 I've always heard that using the include directive outside of classic ASP is a bad idea, I have coded believing that statement, however in a recent arguement, I mean discussion, I had to admit defeat because I couldn't find any supporting documentation for why it's a bad idea. I found a couple places where microsoft said 'generally you should use user controls...' but nothing concrete and specific, and more disappointingly I found some articles that said there is no performance differance, and even one that said it increases performance to use an #include directive. If this is the case then why are so many of us creating inherited pages for templates rather than using includes, or so many other things we do with user/server controls that we could use includes for? Blind ignorance? I personally like OO programming rather than typing html include files at the top of every page, changes are very easy...change the base class!, but not everyone works that deeply. I know a few of you out there, if there is documentation, you have it... and I really hope today you have it.... thanks! Quote
Administrators PlausiblyDamp Posted June 13, 2005 Administrators Posted June 13, 2005 What arguments where put forward for include files? I personally find them cumbersome compared to web controls / user controls and vastly inferior to the up coming templates in .Net 2.0. User controls give you a GUI designer, encapsulate UI and code nicely - can easily be positioned in a page by either a panel or a table. You can also have control over the frequency of code usage by using the OutputCache directive. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
bri189a Posted June 13, 2005 Author Posted June 13, 2005 There was nothing specifically that said it was better or putting it forward, just nothing saying there was something wrong with it. What spurred this whole things was an article in asp.net PRO magazine (this months cover story) which tells readers, as a work around when inheriting a 'base' page to get around the designer hic-cups to use #include files... as I said I generally consider using include file in ASP.NET a bad idea, and preach it mind you, and here is a magazine article that is advicating using them just to get around a fricken designer issue... http://72.14.207.104/search?q=cache:jd_nfZ_t6QMJ:www.informit.com/articles/article.asp%3Fp%3D173411+asp.net+%22include+directive%22+performance&hl=en http://72.14.207.104/search?q=cache:IHsObu9_rOwJ:authors.aspalliance.com/anjum/ASPMigration.aspx+asp.net+%22include+directive%22+performance&hl=en Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.