I have a button control 'AddToCart' and 'picturepath' in a datalist. In the following code, if I browse with firefox or IE , the picture is not flickering. If I browse with Google chrome the picture flickers. How to rectify this, so that it does not flicker in all browsers?
public void dl_item_command(Object sender, DataListCommandEventArgs e)
{
if (e.CommandName == "myevent") // check commandname here
{
int index = e.Item.ItemIndex;
Button dd = (Button)DataList1.Items[index].FindControl("AddToCart");
dd.Text = "Added to cart";
DataTable dt = (DataTable)ViewState["CurrentTable"];
Session["ss"] = dt;
}
}
<asp:DataList ID="DataList1" runat="server" Width="220" OnItemCommand="dl_item_command" RepeatColumns="3" RepeatDirection="Horizontal" >
<ItemTemplate>
<table id="Table3" style=" margin-top:-33px" visible ="true">
<tr>
<td>
<p >
<img src= '<%#DataBinder.Eval(Container.DataItem,"PicturePath") %>'
style="height:200px;width:253px;"/>
</p>
</td>
</td>
</tr>
</table>
<asp:TextBox ID="AddToCartTB" runat = "server" Text='1' Width="44px" > </asp:TextBox>
<asp:Button ID="AddToCart" runat = "server" Text='Add to Cart' Width="100px" commandname="myevent">
</asp:Button>