No-Postback Reload Causing Duplicates :(

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pbd22

    #1

    No-Postback Reload Causing Duplicates :(


    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.EventArg s) Handles Me.Load

    Response.Conten tType = "video/x-ms-asf"
    'Response.Expir es = 0

    If Request.Cookies ("MyCookie") IsNot Nothing Then
    'Response.Cooki es.[Set](Request.Cookie s("MyCookie") )
    Response.Cookie s("MyCookie").E xpires = DateTime.Now
    Else
    UpdateCount(Req uest.QueryStrin g("BID"))
    Response.Cookie s.[Set](New HttpCookie("MyC ookie", "One"))
    Response.Cookie s("MyCookie").E xpires =
    DateTime.Now.Ad dYears(30)
    End If

    Response.Write( ASXHeader())

    If (Request.QueryS tring("adreques t") = 1) Then
    Response.Write( WithAdvertiseme nt())
    End If

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

    End Sub


    Private Sub UpdateCount(ByV al pid As String)

    Dim result As Integer
    Try
    result = SqlHelper.Execu teNonQuery(conS tr, "Count_Upda te",
    pid)
    Catch ex As Exception
    End Try

    End Sub
Working...