ASP in a .html file under .net 4.0

狂风中的少年 提交于 2019-12-11 05:28:19

问题


I'm updating a site from asp.net 2.0 to asp.net 4.0.
I'm running IIS 7.0. If I create test.asp and browse to it it works. If I rename the file test.html it will not parse the asp.

I need html to be parsed as asp because of the CMS we use.

Relevant code from test.html:

<%
Response.Write ("The time on the server is: " & Time())
%>

I think my trouble comes from the way .net 4.0 handles requests.

How do I get IIS to parse html as asp?


回答1:


You will need to associate the same DLL that currently handles your .asp pages to also handle your .html pages in IIS. see here for help with that




回答2:


I don't see the connection between ASP and .NET here.

Are you trying to figure out why the ASP engine is not processing a file with the .HTML extension?

When you name a file with the .ASP extension, it will be processed by the ASP engine. When you name a file with some other extension, like .HTML, it will not be processed by the ASP engine so any ASP-specific markup in it will go through to the client.



来源:https://stackoverflow.com/questions/4785818/asp-in-a-html-file-under-net-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!