Previous Next

Thread: ASPX page displays only html code

Last post 10-12-2008 9:54 PM by steve schofield. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 10-08-2008, 12:32 AM

    • zifooo
    • Not Ranked
    • Joined on 10-08-2008, 4:24 AM
    • Posts 3

    ASPX page displays only html code

    Hi

     I am learning ASP.net so i created a very simple file

    this is the file content

     

    <html>
    <body bgcolor= "yellow">
    <center>
    <h2>Hello World!</h2>
    </center>
    </body>
    </html>

     

    basically i named the file firstpage.aspx and tried opening it using IE and mozilla

    but both fail to display the page and only display the html code

     I have IIS 7 installed, as well as visual developer 2008 and microsoft .net framework 3.5

     any help or thoughts?

  • 10-08-2008, 12:41 AM In reply to

    Re: ASPX page displays only html code

    Verify the asp.net script mappings are on the website.  Also, make sure the web service extensions allow asp.net to execute. 

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 10-08-2008, 11:25 AM In reply to

    • zifooo
    • Not Ranked
    • Joined on 10-08-2008, 4:24 AM
    • Posts 3

    Re: ASPX page displays only html code

    I am doing this on my local machine

    how do i do that?

  • 10-08-2008, 12:31 PM In reply to

    Re: ASPX page displays only html code

    Oh this is IIS 7, sorry.  The concept of script mappings is well, gone. :)  go to Server Manager > roles > Web Server > Role Services and see if Asp.net is installed.  By default, iis only serves static content.

     

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 10-08-2008, 3:10 PM In reply to

    Re: ASPX page displays only html code

    Hi!

    In addition to Steve's suggestion, I would also like to ask how you access the file.

    Do you use http://localhost/firstpage.aspx (or similar), or do you double-click the file in Windows Explorer? A common mistake for people new to ASP.NET is that they do not realize that the code must be executed by IIS, and cannot be opened like a regular HTML-file.

  • 10-12-2008, 10:04 AM In reply to

    • zifooo
    • Not Ranked
    • Joined on 10-08-2008, 4:24 AM
    • Posts 3

    Re: ASPX page displays only html code

    Steve: I cant find the roles in order to configure the server :s

    Kristofer: i used both, http://localhost... and normal file access and both dont work

    i'm new to this :S

  • 10-12-2008, 9:54 PM In reply to

    Re: ASPX page displays only html code

    Here is an image of what I'm talking about.  Server Manager should launch when you login or go to control panel, administrative tools, server manager.  Hope that helps.

    www.iislogs.com/images/servermanager.jpg

     

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
Page 1 of 1 (7 items)
Page view counter