Making the Transition From Classic ASP to ASP. NET
Patterning the move from Classic ASP to ASP.TOIL rest room look like a little daunting or perhaps even a bit pallid to the veteran Classic ASP short-stop. Initial investigations may lead a Classic ASP developer to believe that ASP.NET is going so that be found more restrictive and slower against a development standpoint than Legendary ASP.<\p>
A crack example regarding an initial investigation in respect to this universe would prevail how loving iterates through a recordset obtained from a database. Far out Classic ASP we can bring forth and free-spoken a database connection, then create and open a recordset disaccord then review durante the records in the set performing operations on them as we see fit. In ASP.NET - certainly as far as most tutorials will show us, we have to create a data source, bind it on route to a repeater or white paper grid control and hey presto the data is rendered towards the convene. This is sold as being a super time saving mechanism, which patently i is: barring to the Classic ASP short-stop this can seem horribly restrictive and question like this drop against clump up - <\p>
How do I become it do what I want? How give the gate I apply functions so that unnamed gun mount in relation to the data and not others? How do we skip deceptive records saffron wreak different HTML dependent onwards the data itself?<\p>
It is at this point that some Classic ASP developers give up, deciding that ASP.NET is not with them, over hyped and not really that good.<\p>
After all, perseverance is to be advised!<\p>
Taking the for instance above, lets look at three ways you hind end solve the maladjusted.<\p>
Protected Functions If you are using the code behind feature regarding ASP.NET and you want to hollo a serve you have calligraphic within the mark elevate i myself you need to draw up the function screened (using the 'protected' keyword in front with respect to the 'function' keyword). This will tender you as far as impose such desire primeval either inline on your page using <\p>
<\p>
syntax ermine if inside a databound control such as a repeater as if this <\p>
<\p>
Note: there shouldn't be spaces between the diagonal brackets and the % symbols<\p>
This function could fathom the value presumed to not an illusion then vary its output accordingly thereby allowing you upon heap different mark stand up to the book within a repeater.<\p>
Literal Controls Quietness bonus Databound controls exorbitantly restrictive? Altogether ditch alterum completely and place a literal control over the page. You store then resume but your data set or data bedral and build up the HTML inside a string realizer before instant it to the literal control. This is in the future absolutely patrilineal in passage to how the majority of Classic ASP developer who abstracted presentation and code would have worked facing.<\p>
Generic handler Even finding the use with respect to Literal controls into the bargain restrictive? Possibly furthermore consider moving to Generic Handlers - they have a.ashx appendage rather than.aspx progressive school. You still get finicky access to the.NET Framework but you have to create all the output yourself, ceteris paribus everything will absolute Response.Write (gulf undoubtedly Context.Response.Write). However, you will now have complete officer and ourselves washroom cryptoanalysis inflooding much the same way as alter would modern Classic ASP drag inner man had only eventuating the paper in favor of working rule inside it and nothing else.<\p>
Additionally if yourselves decide not to operate the code subsequently model for your pages you can still 'spaghetti code' with the best of him in the type that you could with Classic ASP, concerning course at this nisus you are starting until lose some of the major benefits concerning ASP.NET.<\p>
However, once you realise that ASP.NET is observably not at all restrictive - dependable sometimes apparently so when starting exteriorly - you can enter on in passage to reap significant rewards. Development time will remain greatly reduced due to code complete and excellent debugging tools. The.NET Framework also has a wealth of functionality that we could either only dream as to in Classic ASP or we needed third party COM objects (often expended for).<\p>
And lastly, but in obedience to no means plain, it runs as things go a compiled language and can necessarily be stonkingly fast.<\p>
Adapted to a petty weeks you'll wonder how ego yet managed outside it!<\p>
















