By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,115 Members | 894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,115 IT Pros & Developers. It's quick & easy.

tracking independant hits to page

P: n/a
I have a page that I need to tell how many INDEPENDANT hits have occurred.

I have the following code:

Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack then
Call InsertAuditRecord()
end if
End Sub

Which just writes out to a table on who hit this page for a particular
record.

This works fine, but if you do a refresh, it gets counted as another hit
since it isn't a postback. Also, the user can go to another page and then
come back to this page and it is another hit.

Is there a clean way to handle this so that only one hit to the page/record
is recorded once for each visitor?

This is for users that haven't logged on yet, so I don't have any logon
credentials yet.

I was thinking of putting a cookie on their machine to track it, but don't
know if that is the best way.

Thanks,

Tom.
Jul 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Yes, I would think that cookies would be a good informal way of doing this.
It's not 100% bullet proof since people could delete their cookies, but you
may not need it to be 100% bullet proof.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"tshad" <ts**********@ftsolutions.comwrote in message
news:O%****************@TK2MSFTNGP04.phx.gbl...
>I have a page that I need to tell how many INDEPENDANT hits have occurred.

I have the following code:

Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack then
Call InsertAuditRecord()
end if
End Sub

Which just writes out to a table on who hit this page for a particular
record.

This works fine, but if you do a refresh, it gets counted as another hit
since it isn't a postback. Also, the user can go to another page and then
come back to this page and it is another hit.

Is there a clean way to handle this so that only one hit to the
page/record is recorded once for each visitor?

This is for users that haven't logged on yet, so I don't have any logon
credentials yet.

I was thinking of putting a cookie on their machine to track it, but don't
know if that is the best way.

Thanks,

Tom.


Jul 19 '06 #2

P: n/a
"Steve C. Orr [MVP, MCSD]" <St***@Orr.netwrote in message
news:uH**************@TK2MSFTNGP03.phx.gbl...
Yes, I would think that cookies would be a good informal way of doing
this.
It's not 100% bullet proof since people could delete their cookies, but
you may not need it to be 100% bullet proof.
That was what I figured. Probably the best I can do.

Thanks,

Tom
>
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"tshad" <ts**********@ftsolutions.comwrote in message
news:O%****************@TK2MSFTNGP04.phx.gbl...
>>I have a page that I need to tell how many INDEPENDANT hits have occurred.

I have the following code:

Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack then
Call InsertAuditRecord()
end if
End Sub

Which just writes out to a table on who hit this page for a particular
record.

This works fine, but if you do a refresh, it gets counted as another hit
since it isn't a postback. Also, the user can go to another page and
then come back to this page and it is another hit.

Is there a clean way to handle this so that only one hit to the
page/record is recorded once for each visitor?

This is for users that haven't logged on yet, so I don't have any logon
credentials yet.

I was thinking of putting a cookie on their machine to track it, but
don't know if that is the best way.

Thanks,

Tom.



Jul 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.