Thread: How does .ASPX generate HTML?

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    58

    How does .ASPX generate HTML?

    I know it may require a hefty explanation, but I was wondering if anyone knew how a .aspx file generates html when you load it into a browser?

    I mean...the first internet explorer came out way before .aspx pages, so how does .aspx work with browsers that came out before its existence?

    What I would really like to know is...if I created a .asdf format, how would I get it to actually load as an html page in browsers, rather than have it display the contents of the file in the browser?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> I know it may require a hefty explanation, but I was wondering if anyone knew how a .aspx file generates html when you load it into a browser?

    The ASP interpreter simply runs the code, which can print HTML as output.

    >> I mean...the first internet explorer came out way before .aspx pages, so how does .aspx work with browsers that came out before its existence?

    It runs on the server, not the client (eg: your browser).

    >> What I would really like to know is...if I created a .asdf format, how would I get it to actually load as an html page in browsers, rather than have it display the contents of the file in the browser?

    Run an ASP server on your computer, I guess.

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    26
    When your browser requests a .aspx page, the server generates the html and sends it to your browser. Browsers don't look at the file extension to decide how to treat each page. When the server sends the HTML, it also sends a content type (text/html for html files). If you look at the source for a page once it's loaded, you'll see that it's just HTML without server specific code, because it's handled by the server before the html is sent to you.

    I hope that wasn't confusing.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    This is true of ASP, JSP, PHP, CGI, etc.... It's merely a program that runs on the server when a request is received. The program outputs HTML and that output is forwarded by the server back to the client. THe only difference is that out of all of these, ASP hides the HTML part of it from you the most. It adds a huge amount of javascript (for AJAX) and HTML to make all the events, etc... work with the server. continuously.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. html web translator/interpreter
    By Aisthesis in forum C++ Programming
    Replies: 6
    Last Post: 08-02-2009, 02:17 PM
  2. Template metaprogramming, whats the point?
    By Cogman in forum C++ Programming
    Replies: 26
    Last Post: 02-01-2009, 11:47 PM
  3. Please Help - C code creates dynamic HTML
    By Christie2008 in forum C Programming
    Replies: 19
    Last Post: 04-02-2008, 07:36 PM
  4. Design + HTML
    By orbitz in forum C Programming
    Replies: 8
    Last Post: 11-21-2002, 06:32 AM