« Previous Next »

Thread: Run HTML pages as >net in IIS 7.0

Last post 06-15-2009 5:50 PM by singhsatyadev. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 06-12-2009, 3:29 PM

    Run HTML pages as >net in IIS 7.0

     Hi

    We are running some HTML files as ASP.net file  with aspnet_Isapi handler in IIS 7.0 in windows 2008. These files are loading, but are loading the .Net script on the top
    <%@ Page Language="C#" %>  

    Here is the sample file in .html file

    <%@ Page Language="C#" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Test</title>
    </head>
    <body>
        <form id="form1" runat="server" method="Post">
        <div>
            comming soon..
            HTML to ASPX
         </div>
        </form>

    </body>
    </html>


    Please let us know how we can run HTML files as ASP.Net files.( We tried both Classic and Integrated mode). The pages are served well in IIS 6, but its not working on IIS 7.0

    Thanks for your help.

    Harsh.

  • 06-15-2009, 1:11 PM In reply to

    Re: Run HTML pages as >net in IIS 7.0

    First, why are you running HTML files as ASP.NET (I assume by changing the extension ro using wildcard extension mapping)?  In IIS7's Integrated Pipeline, every file runs throiugh the ASP.NET pipeline, regardless of it being HTML or ASP.NET or even a JPG.  This pretty much eliminates any valid reason to run plain HTML with an ASP.NET extension or use wild card mapping of extensions.

    Second, what effect does the @Page directive have on your page?  You should see no difference.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 06-15-2009, 5:46 PM In reply to

    Re: Run HTML pages as >net in IIS 7.0

     hi Jeff,

    We are doing some kind of url rewriting here.. the content of the HTML page is being rendered  with a ASPX page on the fly using the url rewriting, our one of the old server is running on IIS 6 and the new server we have IIS 7.0.

     also because of our URLs are  already listed in most of the Search Engines with good PR, so  we can not change it.. although IIS 7.0 have a very good url Rewritter extension.

    so we are using our custom url rewritter module.

    this is the only reason we want to execute our .html pages as ASPX.

     

    Thank you,

    Satyadev Singh 

     

     

     

     

     

     

     

     

     

  • 06-15-2009, 5:50 PM In reply to

    Re: Run HTML pages as >net in IIS 7.0

     if you execute this code as a ASPX you will see only

    comming soon..
     HTML to ASPX

     

    on client side .. and if the page is executed as HTML .. will see 

     

    <%@ Page Language="C#" %>  

    comming soon..
     HTML to ASPX

     

    ** This is just a test page for testing.. nothing to do with our main apps.

     

    Thank you,

    Satyadev

     

     

     

     

     

     

Page 1 of 1 (4 items)