No-Postback Reload Causing Duplicates :(

P

pbd22

Hi.

I have a FF page with a Windows Media Player that is
quickly reloading itself for some reason. The file in question
is a dynamic ASX file that counts hits before it generates
the ASX. I am trying to get around the duplicate update with cookies
but it isn't working :(

Help / Corrections / Brutal Honesty appreciated!

CODE:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

Response.ContentType = "video/x-ms-asf"
'Response.Expires = 0

If Request.Cookies("MyCookie") IsNot Nothing Then
'Response.Cookies.[Set](Request.Cookies("MyCookie"))
Response.Cookies("MyCookie").Expires = DateTime.Now
Else
UpdateCount(Request.QueryString("BID"))
Response.Cookies.[Set](New HttpCookie("MyCookie", "One"))
Response.Cookies("MyCookie").Expires =
DateTime.Now.AddYears(30)
End If

Response.Write(ASXHeader())

If (Request.QueryString("adrequest") = 1) Then
Response.Write(WithAdvertisement())
End If

Response.Write(ASXBody())
Response.Write(ASXFooter())

End Sub


Private Sub UpdateCount(ByVal pid As String)

Dim result As Integer
Try
result = SqlHelper.ExecuteNonQuery(conStr, "Count_Update",
pid)
Catch ex As Exception
End Try

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top