Solved

Can I call an asp function from an html page?

Posted on 2015-01-07
6
119 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
[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
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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Technology Partners: 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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

688 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