473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to get ASP pages to work?

11 New Member
On the adress: http://www.w3schools.com/asp/showasp.asp?filename=demo_intro
is demo of ASP source:

----------------------------------------------------------
<html>
<body>

<%
response.write("My first ASP script!")
%>

</body>
</html>
----------------------------------------------------------

and output result:
---------------------------------
My first ASP script!
---------------------------------

How much I try to put this code in *.html file and later when try to open this file in browser, it's alwayse appears:

<% response.write("My first ASP script!") %>

instead of:

My first ASP script!

Is there eny way to display result of this code correctly?
Jun 12 '11 #1

✓ answered by jhardman

Three things occur to me reading your post.

1-you said you put this in a "html" page, unless you set your server to look for scripts in pages with ".html" file extension it won't execute the script. Normally we put asp scripts in files with extension ".asp".

2- how are you opening the file? Is it being served by a web server, or are you going into your browser's file menu and selecting "open file"? That last option won't work, the asp script has to be executed by a web server, usually IIS (although there is an add-in to make it work in apache) so you need to give your browser the address of a web server that can execute the script.

3- it sounds like you are just starting out with asp. I am going to encourage you to stop and try a different technology. Asp.net is what M$ is pushing now, classic asp was phased out starting in 2003, now most of us who still use it are just maintaining old web sites. So if you like M$ go to asp.net, otherwise you can try php for the free, open-source lovers.

Let me know if this helps.

Jared

6 4892
jhardman
3,406 Recognized Expert Specialist
Three things occur to me reading your post.

1-you said you put this in a "html" page, unless you set your server to look for scripts in pages with ".html" file extension it won't execute the script. Normally we put asp scripts in files with extension ".asp".

2- how are you opening the file? Is it being served by a web server, or are you going into your browser's file menu and selecting "open file"? That last option won't work, the asp script has to be executed by a web server, usually IIS (although there is an add-in to make it work in apache) so you need to give your browser the address of a web server that can execute the script.

3- it sounds like you are just starting out with asp. I am going to encourage you to stop and try a different technology. Asp.net is what M$ is pushing now, classic asp was phased out starting in 2003, now most of us who still use it are just maintaining old web sites. So if you like M$ go to asp.net, otherwise you can try php for the free, open-source lovers.

Let me know if this helps.

Jared
Jun 12 '11 #2
Marko Danilovic
11 New Member
The true is that I just started with ASP. I was thinking that regular "*.asp" file can opened just going into your browser's "file" menu and selecting "open file", didn't know that the asp script has to be executed by a web server.

I like in ASP - FSO (File System Object), with this you can open and writhe something in "*.txt" file or create txt file and much more. TXT files is appropriate for my databases.

Thanks anyway!
Jun 12 '11 #3
jhardman
3,406 Recognized Expert Specialist
So the next thing you need to decide is which server are you going to install. All windows versions except for "home edition" come with IIS as an optional install. If you have a home edition then you will need to consider using apache or a remote host to test your scripts. The downside of apache is that it doesn't natively support asp scripts, you have to add that as an add-on.

Jared
Jun 14 '11 #4
Keith Boesker
14 New Member
Just create an asp page with your script and then do an include file script into your html page. It will include your asp page into your html page. That will work. All asp script must be in a asp extension page but you can include into any page you want. Even php pages as long as you have asp extension enable on you server.
Jun 14 '11 #5
Marko Danilovic
11 New Member
When I include ASP script into HTML page, is it necessary server like IIS and apache or I can just run into web browser without making the web server?
Aug 4 '11 #6
jhardman
3,406 Recognized Expert Specialist
ASP stands for "active server page". Yes, you need the page served by a server. Even if you want to do a "server-side include" the server needs to be running to make the include statement work.

Jared
Aug 4 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: JezB | last post by:
I'm binding a DataGrid web-control to data fetched from a database. However some of my data fields contain text that is within <...> characters - I notice that everything between the <> is...
3
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
3
by: Josh Valino | last post by:
Hi, I have a client that has our product and in one of the aspx files, there is code like this: <%= SomePublicProperty %> where the public property returns a string. In the test...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.