Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Counting Clicks on a Web Site
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Counting Clicks on a Web Site

 Post Reply Post Reply
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Topic: Counting Clicks on a Web Site
    Posted: 20 January 2006 at 6:43am
Please go to http://www.explorencmountains.com/Category.aspx?CatID=76 for an example. If you click on "Get More Information About ______", it will add one to the views for that listing. I know how to do that. But I'd like to be able to count how many people have viewed the company's web site from my web site. I am not sure how to do this.

My code for counting the hits to the listing itself (displayadvertiser.aspx) on my web site is:
 
SqlCmd.CommandText = String.Format("UPDATE Advertiser SET Views = Views + 1 WHERE AdvertiserID = '{0}'", strAdID)
 
This used a querystring so this is different. Could someone please help me? The code needs to be done in VB.Net/ASP.Net.
Back to Top
mack View Drop Down
Groupie
Groupie


Joined: 06 November 2004
Location: United States
Status: Offline
Points: 90
Post Options Post Options   Thanks (0) Thanks(0)   Quote mack Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2006 at 2:45am
Why are you using String.format? I never used that.

When the user clicks, you will need to do this:
SqlCmd.CommandText = "UPDATE Advertiser SET views = Views + 1 WHERE AdvertisterID = '{0}'", strAdId

What I like to do is output the SQL statement to an Response.Write, then test the output in my database program (SQL Manager Express from microsoft).

You can also try grabbing the # of views from the database with a SELECT, setting it to a variable, then adding one to it, and then updating it like that with almost the same SQL statement.

Edit: What was the error?


Edited by mack - 28 January 2006 at 2:45am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.