- Link to What is Programming?
- Link to What is a Programing Language?
- Browser requests a web page.
- The web page code is loaded into memory.
- The web page code is compiled the first time it is loaded and its machine code is cached.
- The machine code is executed. This outputs html which is sent to the browser.
- For more about Machine Code See What is a Compiler?
Web sites have gone through several generations of technology:
- Simple HTML pages.
- CGI (Common Gateway Interface). A compiled exe is loaded and run for every page request. Inefficient!
- ISAPI DLL. A Dll that processes every request; this was invented by Microsoft.
- Interpreted Scripting Languages: eg ASP (the precursor to ASP.NET), JSP (Java Server Pages), PHP (the most popular open source web technology) and many others.
- ASP.NET. Compiled C#/VB.NET. (Or any .NET languages that runs on the CLR eg C++/CLI). This is now up to version 3.5.
As well as running compiled code, an important aspect of ASP.NET is that it allows you to separate the HTML/XHTML from the C#/VB.NET code. One of the biggest criticisms of other server side technologies is that they were implemented by adding the code within html pages using special tags. It looks horrible and be difficult to maintain. PHP addressed this with a variety of 3rd party templating technologies but ASP.NET now has it built in since version 2.0. Under original ASP you might have had a page Default.asp containing html with embedded VbScript (the interpreted script language).
- For More about Interpreted Languages see About Compilers and Interpreters
- Default.aspx
- Default.cs
Master Pages
Microsoft have taken a trick from their PowerPoint application with Master Pages. In PowerPoint you can create a Master Slide that acts as a template for all other slides. The background and common text on the Master Slide is automatically used in other slides.Likewise the Master Page is used to create the look and feel of an ASP.NET web application. Content place holders are used to allocate places on the Master Page that will be changed on the content pages. Most web pages have a non visible part (called the head) as well as the body which is the visible part. In the head you specify certain Meta fields such as the page description and keywords. These vary from page to page so if you're using a Master Page then this is where you would put one Place Holder. You can have multiple Place Holders on the same page.
When a page is loaded, if a Master Page exists for it then the two are combined with the content from the page filling in the place holders on the Master Page. If you have ever hand coded a website then by comparison this simplifies enormously the task of maintaining a big site.
Events
One of the more problematic aspects of web development is firing events when a web page loads. Usually this is done by just putting in some JavaScript which runs after the page is loaded. With ASP.NET 2.0 and higher there are a number of events that can be processed as the page loads, in this order.- PreInit - Just before the page is initialized
- Init - as the page is beining initialized
- InitComplete - after the page has been initialized
- PreLoad - before the page has loaded into memory
- Load - as the page is loaded
- LoadComplete - after the page has loaded
- PreRender - before the page is rendered in the browser
- PreRenderComplete - after the page has been rendered
- Unload - as the page is unloaded.
Server and Web-Server Controls
ASP.NET supports two type of controls. Simple HTML server controls and the more complex Web server controls. The HTML controls are intended for converting older ASP websites to ASP.NET. Just add the tag runat="server" to a normal HTML control such as forms, input or buttons.Web server controls are a bit like controls you drop on forms and provide more complex functionality. For example it's a lot easier to populate a drop-down at run-time using a drop-down control. As well as better versions of the standard HTML controls there are much more sophisticated controls: calendar server, panel server, file upload and even a wizard server control.
Conclusion
Much as programming languages have evolved from machine code up to higher level languages, web development has moved on from simple client html output to more complex server side technology. The ultimate web sites of course are sophisticated Contents Management Systems (CMS) where everything about the site is stored in databases and generated on the fly. But those are expensive and for building normal websites ASP.NET is about the most advanced server-side technology currently in existence.- If you want to learn ASP.NET, start with the C# Tutorials.
We will have ASP.NET tutorials here but they are not here yet.

