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
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