Tutorials » AspNet tutorials »

How ASP.NET is converted to HTML?

This article how ASP.NET pages are sent as HTMl to browsers.

In an earlier chapter you learned that browsers can understand only HTML (and some client side scripts like javascript).

So, what does that mean? Does it mean you cannot develop ASP.NET pages to view in a browser?

This is the concept:

You can use web development technologies like ASP.NET, PHP etc to develop web sites. But what is happening behind the scenes is, the above technologies are used to dynamically generate html. What is sent from web server to the browser is just plain html. That why browsers are able to display web pages developed using ASP.NET.

Whatever technology you use to develop web pages, what is sent from server to browser is just plain html. Depdning on various conditions, ASP.NET generate different html. I will prove this with an example.

If you have NOT logged In to this site, you can see a link called "Login" in the top left corner. If you are logged in, you will see Welcome TONY. (You will see your name instead of TONY, but I am using my name for this example)

We use ASP.NET to determine wether user has logged in or not. If logged in, then our ASP.NET code will generate the following html:

<a href=ViewProfile.aspx?UserId=tony>Welcome TONY !</a>

If the user is NOT logged in, then our ASP.NET code will generate the following HTML:

<a href=Login.aspx>Login</a>

Did you notice that the above samples show plain html? Depending on various conditions, ASP.NET generate appropriate HTML. This is what sent to browsers. You can right click on in any web page and select View Source to see the actual HTML. Try to see the source html of this page.

Browsers always see plain html (the same html you see by Right click -< View Source) . They dont care how the html is generated, what is the technology or programming language (ASP or ASP.NET or PHP) used to generate those html etc. . Even if some other company comes up with a new technology for web development, all browsers will still work as long as those technologies generate proper html.

This is the fundamental concept behind web development. It is very important to understand this concept clearly before you proceed with ASP.NET programming.

Next Chapter: Static and Dynamic web pages
Previous Chapter: How browsers understand ASP.NET web pages?
More Chapters: ASP.NET Tutorials
More Tutorials: Tutorial Index

Top Contributors
TodayLast 7 Daysmore...

Awards & Gifts

Online Members

Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India