Can a .aspx file be renamed to .htm?

B

Bruce W...1

Would the code-behind and all ASP.NET functionality still work if the
..aspx files had instead .htm extensions? I suppose it boils down to
whether the page directives would still work.

Thanks for your help.
 
F

Frank Drebin

No, there is an ISAPI filter that only process those files with the correct
file extension... if you rename it, it won't be processed correctly..
 
J

Jeremy

Well in the IIS Application Configuration there is no
entry in the Application Mappings for a .htm file type.

I'm not sure, but I would guess that if you added a .htm
file type, set the executable path to the ASP.NET ISAPI
DLL, and set the Verbs to be the same as that of a .aspx
file (GET,HEAD,POST,DEBUG) you might get it to work.

Good Luck,
Jeremy
 
M

MS News \(MS ILM\)

If you try it can you please let us know

Jeremy said:
Well in the IIS Application Configuration there is no
entry in the Application Mappings for a .htm file type.

I'm not sure, but I would guess that if you added a .htm
file type, set the executable path to the ASP.NET ISAPI
DLL, and set the Verbs to be the same as that of a .aspx
file (GET,HEAD,POST,DEBUG) you might get it to work.

Good Luck,
Jeremy
 
M

MS News \(MS ILM\)

It works,

Jeremy said:
Sorry, but I personally won't try it because I don't have
an environment where I would want to test this out (and I
wouldn't want to risk screwing anything up with .html
files because if you can get to .html files you know IIS
is working).

However, if somebody would like to try this and not use
an .html extension... Create (make up) a brand new file
extension (maybe have files called mypage.irule, as
opposed to mypage.aspx), add of the info from my previous
post in IIS and try it out.

At least this way you won't risk the possibility of
screwing up anything with .html files.

And please, if somebody does try this post something in
this newsgroup to let us know if it works.

Thanks,
Jeremy
 
J

Jeremy

I should note that I've done this (created my own
extension, not setup something for .html) to handle .asp
files, and I haven't had any problems.

So it will be interesting to see if somebody tries this
for .aspx, but I don't see any reason why it wouldn't work.

Cheers,
Jeremy
 
M

MS News \(MS ILM\)

Yes I tried it and it works
I changed the extension on an .aspx file to .html and I got the same result
no problem
 
M

MS News \(MS ILM\)

Yes I now tried changing .aspx to .html and still works just fine
you need to add the mapping in IIS however
works no problem so far.
 
M

MS News \(MS ILM\)

Html works fine
Htm works fine
aspx code did not execute when .htm or .html extension
strange
Sorry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top