COB logo COB honor code logo

 

BA372 — ASP.NET Lab

 

One of the issues that makes web-based programming a bit trickier than non-web-based programming, is that in order to run a web-based program, you need a web server (see diagram above) through which to request and run the web app which generates the HTML to be rendered on your browser. In many cases, your company's production web server will not be available for this type of development runs —after all, we do not want the production and development side of the house to be intermixed— so traditionally you would have to install a web server on your development machine or copy files over to a shared 'sandbox' area on the file system accessible through the web server to do web development. Especially in lab situations such as ours, this can be a real hassle and hence, it is very(!) convenient that the Visual Studio IDE has its own, built-in web server that is used to run .NET web-based programs during development. The server is automatically started when running or debugging an ASP.NET page and is nicely integrated into the debugging environment.

 

Notice how in the Trace Information section of your browser's output, the Trace.Write() information appears. Notice that it was the first Trace command executed (it is in the Page_Load() method so it is the first thing executed on this page. Notice, also how many other methods are executed after Page_Load() ; e.g., LoadComplete(), Prerender(), Render(), etc. This whole stack indicates all the default methods which are automatically called when rendering an aspx web page. Programmers can provide code for each and any of these if so desired.