Link to home
Start Free TrialLog in
Avatar of Iamme
IammeFlag for Mexico

asked on

How can I execute asp code in a HTML web page?

HI,
is it possible to execute ASP code embedded in a HTML file, I know that in an ASP file I can use
<!-- #INCLUDE FILE="myaspfile.asp" -->
for call another asp code but,

can a page.HTML executes asp code...?
Avatar of pr0t0c0l12
pr0t0c0l12

Include a file that has your code.
<!--#include file="folder/file.asp"-->
Hope this helps you.
HTML is not an active server code runner.  The solution you are taking is good.
Avatar of Iamme

ASKER

ok,
so just for confirm...
I CAN CALL ASP  CODE FROM AN ASP FILE(for example MAINP.ASP CAN call ROUTINE.ASP)
but
I CAN NOT CALL ASP CODE FROM AN HTML FILE(for example MAINP.HTML CAN NOT call ROUTINE.ASP)

is it ok?
ASKER CERTIFIED SOLUTION
Avatar of pr0t0c0l12
pr0t0c0l12

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Iamme

ASKER

mmm...do I have to do something...?
I test your code in a test.tml page and it doesn't work.....it's strange....is it my IIS configuration?
You have to allow the active server pages option in your iis configuration in order to run asp pages. What kind of error did you get!!!
If you have access to IIS, you can confgure it to allow .HTM and .HTML extensions to be parsed by the ASP processor (this is actually something that I do on a regular basis for customers, especially in cases where we want to preserve page names for SEO purposes):
The instructions below are for IIS 6:
(1) Open IIS, find your site in the left nav, right-click and select "Properties".  
(2) When the properties box comes up, click the "Home Directory" tab.  In the "Application Settings" box near the bottom, click on "Configuration."
(3) In the top box, scroll down to the .asp selection.  Select it and click "Edit."
(4) Select the entire path and filename in this box, and hit Ctrl-C to copy it,.  This is the full path to your ASP processor.  Once copied, hit "Cancel" to close.
(5) Back in the "Application Configuration" box, click "Add."  A new box will pop up.
(6) In this box, set the following:
Executable: (Hi Ctrl-V to past the ASP executable here)
Extension: HTM
Verbs: Select "Limit To" ... in the box type "GET,HEAD,POST,TRACE" (without the quotes)
(7) Click "OK."  The box will close.
(8) Repeat steps 5, 6, and 7, replacing the extension with HTML.
Continue to hit "OK" until you get back to the main IIS screen.  That's all there is to it!
 
Avatar of Devario Johnson
^^^^^^^^^^^^^ Good solution!
Avatar of Iamme

ASKER

I'm doing that skeator said...

wait please...and thanks
Hey lamme...just wanted to follow up and see if you were able to get this to work for you.
Thanks!
Avatar of Iamme

ASKER

Hi,
Tnks, no,OK button is disable, I think because my user doesn't have permissions...
I still working and I tell...
tnks