Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can I call an asp function from an html page?

Posted on 2015-01-07
6
Medium Priority
?
125 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 84

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 34

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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 style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

604 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