Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I browse using the following code, there is no flickering in IE. When I browse with Chrome there is flickering. If I remove the line 'img src' there is no flickering, but I require the image. Can anyone help me out, please?

XML
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"   >
    </asp:ScriptManager>
    <div>
    <asp:UpdatePanel ID="UpdatePanel133" runat="server" >
    <ContentTemplate>
    <asp:Panel ID="dd" runat="server">
    <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>
     <table id="Table6" cellpadding="1" style=" margin-top:-26px ; margin-left:86px"  cellspacing="1" visible ="true">
    <tr>
    <td >
    <p align="left">
    <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>
    </p>
    </td>
    </tr>
    </table>
    </ItemTemplate>
</asp:DataList>
</asp:Panel>
</ContentTemplate>
 </asp:UpdatePanel>
</div>

 </form>
Posted
Comments
S.Rajendran from Coimbatore 17-Feb-14 0:35am    
I use the 'AddToCart' button.
The following is code behind;
protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{

DataTable tb = new DataTable();
tb = (DataTable)Session["ss"];
ViewState["CurrentTable"] = tb;
List<string> adds9 = new List<string>();
SqlDataAdapter da9 = new SqlDataAdapter("select ProductName,PicturePath from product", con);
SqlCommandBuilder cb9 = new SqlCommandBuilder(da9);
DataSet ds9 = new DataSet("product");
da9.Fill(ds9, "product");
DataList1.DataSource = ds9;
DataList1.DataBind();
DataList1.Visible = true;
}
}
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;
}
}

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