Solved

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

Posted on 2008-10-16
11
709 Views
Last Modified: 2013-11-05
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...?
0
Comment
Question by:Iamme
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 7

Expert Comment

by:pr0t0c0l12
ID: 22734912
Include a file that has your code.
<!--#include file="folder/file.asp"-->
Hope this helps you.
0
 
LVL 7

Expert Comment

by:pr0t0c0l12
ID: 22734917
HTML is not an active server code runner.  The solution you are taking is good.
0
 

Author Comment

by:Iamme
ID: 22735031
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?
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 7

Accepted Solution

by:
pr0t0c0l12 earned 200 total points
ID: 22735107
True.  You can include the asp files in your html.  You can also include txt files with your functions so a typical html file will have a couple of asp include files which will generate information for you and then you can display messages by adding the nice html code in your asp sites.  
Remember that every time you define html code you have to close the code section and open after that.  Example
 

<html><body>
<%
time()
%>
</body></html>
This will display the time in an asp page.  Now if you include this file in an index.html, it will include the time first thing.  You can get creative with includes......
 
Good luck.

Open in new window

0
 

Author Comment

by:Iamme
ID: 22735171
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?
0
 
LVL 7

Expert Comment

by:pr0t0c0l12
ID: 22737098
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!!!
0
 

Expert Comment

by:skeator
ID: 22737343
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!
 
0
 
LVL 5

Expert Comment

by:Devario Johnson
ID: 22737639
^^^^^^^^^^^^^ Good solution!
0
 

Author Comment

by:Iamme
ID: 22742748
I'm doing that skeator said...

wait please...and thanks
0
 

Expert Comment

by:skeator
ID: 22749642
Hey lamme...just wanted to follow up and see if you were able to get this to work for you.
Thanks!
0
 

Author Comment

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

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Table style position to the left 8 38
CSS for Popup in ASP.NET 4 48
Error Handler 8 40
Editing .asp website 5 30
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question