Skip to content

Image in itemtemplate disappear when load image handler

Hazel Mahmud

Asked Mar 14, 2015, 8:20 PM EDT2 answers
Share
LinkedInX
i have below code

. aspx file




 
 

AutoGenerateColumns="false" OnRowDataBound="gvUserInfo_RowDataBound" GridLines="None" BorderStyle="Solid" BorderWidth="1px"  BorderColor="#df5015">


















 













 


 
  <%----%>
 
 
 













 





aspx.cs code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using WebApplication_t630staf;
using session;
using Sybase.Data.AseClient;
using System.Text.RegularExpressions;
using System.Text;
using System.Web.UI.HtmlControls;


namespace session
{
  public partial class WebForm8 : System.Web.UI.Page
  {
  AseDataAdapter da = new AseDataAdapter();

  protected void Page_Load(object sender, EventArgs e)
  {
  if (!IsPostBack)
  {
  }
 
  protected void gvUserInfo_RowDataBound(object sender, GridViewRowEventArgs e)
  {
  using (AseConnection persisConn = ClassConn.GetPersisConnection())
  {
  persisConn.Open();
 
  string Nopkj = e.Row.Cells[1].Text;

  if (e.Row.RowState != DataControlRowState.Edit) // check for RowState
  {
  if (e.Row.RowType == DataControlRowType.DataRow) //check for RowType
  {

  GridView gv = (GridView)e.Row.FindControl("gvChildGrid");
 
  AseCommand cmd = new AseCommand("select nopkj = convert(varchar(8),f630nopkj), nama = f630nama from t630staf where convert(varchar(8),f630nopkj) ='" + Nopkj + "' UNION select nopkj = f620nopkj, nama = f620nama from t620sambilan where UPPER(f620nopkj) ='" + Nopkj + "'", persisConn);
  AseDataAdapter da = new AseDataAdapter(cmd);
  DataSet ds = new DataSet();
  da.Fill(ds);

  gv.DataSource = ds;
  gv.DataBind();
  }
 
  persisConn.Close(); 
  }
  }
  } 
 
  }

my plus.gif image will disappear when the image handler loads. the image are successfully retrieved but the plus.gif image disappear. why is that & how do i solve it.. please help.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.