Solved

Can I call an asp function from an html page?

Posted on 2015-01-07
6
116 Views
Last Modified: 2015-01-08
Hi,

This is probably a really stupid question, however, I'm not very familiar with ASP. Is there any way that I can use an ASP function to count the number of hits to an html page, and display those results on a separate page? I don't want to have a visual hit counter, so I was going to display the results on a separate page. Someone told me I would have to convert the html page to an asp page in order for it to work. Is that correct? Is there any other way I could do it? I can't use 3rd party systems to gather the info.
0
Comment
Question by:savache27
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40536173
If you want to count the hits, then all you need to do is keep the counts in a file or database table on the server and update it for every page request, For the display pag you just read the file or query the DB for the values.

Cd&
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40536175
That is correct.  HTML by itself does not support any kind of programming except for javascript in the browser.  The server logs usually keep track all accesses so if you can find a log program that will process your server logs, you can find the info there.
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40536194
it would make your life that much easier to use some kind of server side language, such as classic asp, that way you can easily connect to a database on your server and store the info there. You could look into client side data storage, but that could get complicated if you're not familiar with the concept.

I found this tutorial that may help get you going in the right direction. It basically collects a lot of user stats, you could extract just the pieces you need for just a hit counter.

http://classicaspreference.com/aspexamples/classic_asp_track_visitors.asp
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 40536267
"I can't use 3rd party systems to gather the info."
This is a shame, because Google Analytics would be the easiest way to do something like this.  If you mean you can't use a third-party product on the Internet, consider Piwik, which can be installed on your own network, so you have complete control over it.

If you really can't use a third-party solution, you could create a second web site that DOES use ASP/ASP.Net, then include a reference to a page on the the ASP site from the HTML site.  Every time a page on the HTML site loads, it calls the ASP site and the ASP site registers the hit.  The ASP site can record the name of the calling page and update a database to keep track of the page, date/time, etc.
0
 

Author Closing Comment

by:savache27
ID: 40538853
Thanks for all the responses. I ended up creating an ASP page and included a reference to it from the HTML page like paulmacd suggested.
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 40538861
Thanks for the points.  Happy to help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
html input 8 56
How to eliminate "realname" and "email" from formMail.php (tectite.com) results. 3 68
JQuery conflicts/syntax issue 4 23
window close link 7 32
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

680 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