jeudi 13 août 2015

Label appears in IE but not Chrome?

I'm working on a website that displays a lot of products in little "cards" so they all appear in the same format, however... some of the products are displaying in Chrome without their prices, I've checked in other browsers and the issue is only in Chrome.

This is taken form Internet Explorer and shows what the product cards should look like.

enter image description here

And this is the same product in Chrome:

enter image description here

Very helpfully displaying a cost of not there.

HTML - The label in question is lblProductPrice

<div class="index-row">
    <asp:DataList runat="server" ID="dlFeaturedProducts" RepeatColumns="5" RepeatDirection="horizontal" RepeatLayout="Flow" >
        <itemstyle VerticalAlign="top" />
        <itemtemplate>
            <asp:Panel ID="pnlProduct" runat="server" defaultbutton="btnBuy">
                <div class="gallery-product">
                    <div class="gallery-product-image">
                        <asp:HyperLink ID="hlProductImage"  runat="server"><img id="imgProduct" runat="server" /></asp:HyperLink>
                    </div>

                    <div class="gallery-product-details">
                    <div class="gallery-product-freight">
                            <span runat="server" id="divFreeFreight" visible="false"><img src="images/free-delivery.png" alt="Free Shipping On This Item" title="Free Shipping On This Item" /></span>
                        </div>
                        <div class="gallery-product-title">
                            <asp:HyperLink ID="hlProductTitle" runat="server"></asp:HyperLink></strong><asp:Label ID="lblProductID" runat="server" Visible="false"></asp:Label>
                        </div>
                        <div class="gallery-product-price">
                            <asp:Label ID="lblProductPrice" runat="server"></asp:Label> <span class="gallery-product-price-gst">Incl GST</span>
                        </div>
                        <div class="gallery-product-usually">
                            <span id="pnlUsually" runat="server"><asp:Label ID="lblWas" runat="server"></asp:Label><asp:Label ID="lblListPrice" runat="server"></asp:Label></span>&nbsp;
                        </div>

                          <div class="gallery-product-blurb">
                            <asp:Label ID="lblWebBlurb" runat="server"></asp:Label>
                        </div>
                    </div>
                    <input name="hidden" type="hidden" id="UniqueCode" value="" runat="server" />
                    <div class="gallery-buy-bg">
                        <div class="gallery-buy">
                            <asp:TextBox ID="txtQuantity" Text="1" Width="25" MaxLength="4" runat="server" CssClass="textbox" style="text-align:center"></asp:TextBox><br />(quantity)
                        </div>
                        <div class="gallery-buy-button">
                            <div class="grey-button">
                                <asp:LinkButton ID="btnBuy" runat="server" title="Add to Cart" Text="Add to Cart" CommandName="Add" />
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
        </itemtemplate>
    </asp:DataList>
</div>

VB.Net - I've tried setting the value for lblProductPrice before, after and in the if/else statement and it makes no difference to either browser.

'Show Product Savings even if discount level on login
            If dr("SELLPRICE9") > 0 And dr("pListPrice") = 0 Then
                If ((dr("SELLPRICE9")) - dr(c.GetPriceLevel())) > ((dr("SELLPRICE1")) - dr(c.GetPriceLevel())) Then
                    'lblProductPrice.Text = "$" + FormatNumber(dr(c.GetPriceLevel()), 2)
                    'lblProductPrice.ForeColor = Drawing.Color.Black
                    lblListPrice.Font.Strikeout = True
                    lblWas.Text = "RRP "
                    lblWas.ForeColor = Drawing.Color.Red
                    lblListPrice.Text = "$" + FormatNumber(dr("SELLPRICE9"), 2)
                    lblListPrice.ForeColor = Drawing.Color.Red
                Else
                    lblWas.Text = ""
                    'lblProductPrice.Text = "$" + FormatNumber(dr(c.GetPriceLevel()), 2)
                    'lblProductPrice.ForeColor = Drawing.Color.Black
                    lblListPrice.Text = ""
                End If

            Else
                If (dr("SELLPRICE1")) > (dr("pListPrice")) Then
                    'lblProductPrice.Text = "$" + FormatNumber(dr(c.GetPriceLevel()), 2)
                Else
                    'lblProductPrice.Text = "$" + FormatNumber(dr(c.GetPriceLevel()), 2)
                    lblWas.Text = "Save $"
                    lblListPrice.Font.Strikeout = False
                    lblListPrice.Text = FormatNumber((dr("pListPrice") - dr(c.GetPriceLevel())), 2)
                    If (dr("pListPrice") - dr(c.GetPriceLevel())) = 0 Then
                        lblListPrice.Visible = False
                        lblWas.Visible = False
                    End If
                End If
                'If lblListPrice.Text <= 0 Then
                '    Dim pnlUsually As HtmlContainerControl = CType(e.Item.FindControl("pnlUsually"), HtmlContainerControl)
                '    pnlUsually.Visible = False
                'End If
            End If
            lblProductPrice.Text = "$" + FormatNumber(dr("SELLPRICE1"), 2)
        End If



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire