Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 27, 2012 10:07 AM by sumitacc
Jun 27, 2012 09:29 AM|LINK
i want a code to will count and show the number of viewers to a post on a page once the link has been clicked
Jun 27, 2012 09:33 AM|LINK
hope this helps...
Jun 27, 2012 09:39 AM|LINK
Use Sql Database and Make Table Named "Counter" Make a new Column Name for e.g "PostViewed" and "PostNumber"
and on Page load use this type of Logic.
Read data by SqlReader About the Post and also read PostViewed column Query will be like "SELECT * FROM Counter Where PostNumber = '" + TakePostNumber + "' then increment +1 and store UPDATE PostViewed the incremented Value, and then you will resolve your
its Logic.. hope you will resolve your issue soon
These links will help you!
Jun 27, 2012 09:46 AM|LINK
Use as below
if(Application["HitCount"] != null)
Application["HitCount"] = 1;
Application["HitCount"] = (Convert.ToInt32(Application["HitCount"].ToString())+1);
You can control even in the Session Start of Global.asax or from the Login Form
Jun 27, 2012 10:07 AM|LINK
for your requirement i suggest you to use Application Variable and when the button is clicked inrease the value of Application Variable by one
you can use database make column with no of viewers and update that value by increasing one when the button is clicked.