locked
Some caching issues with AJAX Repeater in Chrome RRS feed

  • Question

  • User-2132821529 posted

    I have simplified the repeater to its bare bones and posted it in hope that you can replicate the problem. To be exact it happens on Chrome and mine is Version 31.0.1650.57 for XP. But it could e on other's versons too.

    http://netsetix.com/WebForm1.aspx

    So please open this link in Chrome and Add to cart say at least 3 items (it is not real DB driven adding). Then go either Forward or Backward with browser's buttons. Then get back to this page, again with browser's buttons and click on any of the items you previuosly clicked. The problem - all messages on all previuosly clicked items pop at once.

    The code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Sample of the Ajax repeater problem. Standart button</title>
        <link href="~/Styles/naviga.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
    <h1>Sample of the Ajax repeater problem. Standart button</h1>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>

    <asp:Repeater ID="rptFashion" runat="server" EnableTheming="False">
    <ITEMTEMPLATE>
    <div class="rep_wrapper">
    <div class="rep_leftCol"><h2><%# CType(Container.DataItem, System.Data.DataRowView)("product_name")%> </h2>
    <asp:Literal ID="ltlAdded" runat="server" Text='<%# CType(Container.DataItem, System.Data.DataRowView)("item_added_message") %>'></asp:Literal></div>
    <div class="rep_rightCol"><asp:Button runat="server" Text="Add To Cart" CommandName="bottonAdd" CssClass="buttonWidth" /></div>
    <div class="clearBoth"></div></div>            
    </ITEMTEMPLATE>
    </asp:Repeater>

    </ContentTemplate></asp:UpdatePanel>
    </form>
    </body>
    </html>

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

            If Not Page.IsPostBack Then

                column = New DataColumn
                column.DataType = System.Type.GetType("System.String")
                column.ColumnName = "product_name"
                dt_source.Columns.Add(column)

                column = New DataColumn
                column.DataType = System.Type.GetType("System.String")
                column.ColumnName = "item_added_message"
                dt_source.Columns.Add(column)

                Dim i As Integer = 0

                For i = 1 To 4

                    custrow = dt_source.NewRow()

                    custrow("product_name") = "Product " & i.ToString

                    custrow("item_added_message") = ""

                    dt_source.Rows.Add(custrow)

                Next i

                rptFashion.DataSource = dt_source

                rptFashion.DataBind()

            End If
        End Sub

     Protected Sub rptFashion_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptFashion.ItemCommand

            If (e.CommandName = "bottonAdd") Then

                Dim frontMessage As Literal = CType(e.Item.FindControl("ltlAdded"), Literal)

                frontMessage.Text = "<p class=""congrad"">Item Added To Cart</p>"

            End If
        End Sub

     

     

     

     

     

    Friday, December 20, 2013 5:09 PM

Answers

All replies