Search:
Namespaces
Discussions
.NET v1.1
Feedback
Mapping .html to ASP.NET
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngconfig' list
.
Howard Cheng
Hello,
We're doing some work for a client, adding some dynamic content to a
currently static site. Because this involves changes to their site
navigation, we want to redo that part as a user control. But in order to do
that, we have to convert all of the web pages to ASP.NET.
The problem is, with the schedule we have, we don't have the time to change
the extension of every file from .html to .aspx, as well as all the links
in all the pages (even with global search & replace tools).
So, our solution is to map .html files to aspnet_isapi.dll in the IIS
settings, but this doesn't seem to work -- the .html files are not being
parsed by the ASP.NET scripting engine.
Does anyone know if this is possible? Or do we just have to bite the bullet
and change everything to .aspx?
Thanks in advance.
::::::::::::::::::::::
Howard Cheng
Click here to reveal e-mail address
AIM: bennyphoebe
ICQ: 47319315
Reply to this message...
G. Andrew Duthie
Have you added the following to your web.config file? (or to the
<httpHandlers> section of machine.config, if you want it to be
machine-wide. Note that if you're adding this to machine.config, you
should only add the <add> element to the existing <httpHandlers>
element, not create a new one)
<httpHandlers>
<add
verb=3D"*"
path=3D"*.html"
type=3D"System.Web.UI.PageHandlerFactory" />
</httpHandlers>
If not, you should try adding it. In combination with the mapping in
IIS, I believe that should work.
Hth,
--
G. Andrew Duthie
Graymad Enterprises, Inc.
http://www.graymad.com
Click here to reveal e-mail address
Author, Microsoft ASP.NET Step By Step
http://www.amazon.com/exec/obidos/ASIN/0735612870/
[Original message clipped]
Reply to this message...
Howard Cheng
Thanks for your reply.
We got this part on our own but now, when we view the .html page in a
browser, we get the generic ASP.NET error page, which says we have to add
<customErrors mode="Off" /> to the web.config file, but that's been there
all along, so now I'm stuck again.
At this point, we haven't done anything besides move navigation elements to
a .ascx user control -- nothing dynamic yet. I've removed all ASP.NET code
from the .html file and it still keeps coming up with this generic runtime
error page. In fact, I can't even get to any .aspx files anymore. Do I need
to explicitly map those extensions now?
Thanks.
At 04:42 PM 4/12/2002 -0400, G. Andrew Duthie wrote:
[Original message clipped]
::::::::::::::::::::::
Howard Cheng
Click here to reveal e-mail address
AIM: bennyphoebe
ICQ: 47319315
Reply to this message...
Howard Cheng
OK, I finally got it to work ... after four hours!
I was following the example in my Wrox book, which had:
<httpHandlers>
<add verb="*"
path="*.html"
type="System.Web.UI.PageHandlerFactory,System.Web" />
</httpHandlers>
But this by itself caused an error where it could not load System.Web. So I
then added:
<assemblies>
<add assembly="System.Web" />
</assemblies>
Which then gave me the generic error message. By removing any reference to
System.Web, the .html extension now properly executes ASP.NET code. Thanks
for nothing, Wrox!
Thanks Andrew for the help and the example, which pointed me in the right
direction.
::::::::::::::::::::::
Howard Cheng
Click here to reveal e-mail address
AIM: bennyphoebe
ICQ: 47319315
Reply to this message...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com