Click here to Skip to main content
15,899,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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;
}
}

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


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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900