Pages

About Me

My photo
ForEach(Minute in MyLife) MyExperience ++;

Wednesday, July 27, 2011

How browsers understand ASP.NET or PHP pages?

How browsers understand ASP.NET or PHP pages?

If visit any web site, no matter what technology is used to develop the site, your browser will be able to display the page for you. The only thing a browser can understand is "HTML". It does not know ASP.NET or PHP. So, even if your web site is developed using ASP.NET, still your browser can understand only HTML.

This is how it works:

You type a URL in your browser. (Eg: http://www.xyz/asp.net/lesson1.aspx)
Your browser will compose a request for this page and send to the web server in
internet. The web server analyzes the request and it understands that the request is for an ASP.NET page called "lesson1.aspx". So, the web server hand over the request to the aspnet service running as part of the web server. (If the page is a .php file,then there must be a php service running on the webserver).The aspnet service loads the page "lession1.aspx". Inside this page, we have written code to read the TutorialId passed as a parameter (parameters are called "Query String"). Our code gets this tutorial id and then retrieves the corresponding content from the database. Then our code embeds this content into the page and returns the dynamically modified page content to the web server. Web server returns the dynamically generated page to the browser. This dynamically generated page has only HTML in it, even though this html came from database. When the browser receives the page, it has only HTML. So, as far as a browser is concerned, it does not care what type of web site it is. It can be any technology like ASP.NET or PHP. It is the responsibility of the web server to generate dynamic content from database or wherever and give only HTML page content to the browser.

1 comment:

  1. Well said my fren.Many of us must know that browser plays a vital role as it only accepts the HTML rather than all the coding of ASP and PHP.This shows the importance of markup language.

    ReplyDelete