Using <% %> blocks

BlazBlader

New Member
With ASP, I kept seeing articles warning to go in and out of ASP code blocks as little as possible, so I did. It's a real pain when dynamically writing HTML, etc., though. Is this still an issue with .NET? All the code samples I've seen from MS use the code blocks quite liberally. Was this really even an issue with ASP? TIA<BR><BR> TomI can't answer your question from a .NET standpoint, but from a classic ASP standpoint I can. As it turns out, all the fear of context-switching wasn't really well-founded. In theory it would slow down performance, but in practice the ASP content gets cached and so your performance hit is only experienced the first time you pull the page up in your browser. After that, reference is made to the cached information and no real performance degradation is experienced.<BR><BR>There may be some out there who would disagree, but I have found this to be absolutely true through extensive testing. Bottom-line: Don't worry about context-switching in classic ASP.<BR><BR>I would assume that the same is true for .NET, but I cannot say for sure as I have not tested this in that environment. Hopefully someone else out there will be able to answer that part of your question.<BR><BR>~~ Tony
 
Back
Top