hi sir this is view page?
string constr = ConfigurationManager.ConnectionStrings["CONSTR"].ConnectionString;
private int id = 0;
protected void Page_Load(object sender, EventArgs e)
{
id = Convert.ToInt32(Request.QueryString["id"].ToString());
if (!IsPostBack)
{
BindControlvalues();
}
}
private void BindControlvalues()
{
SqlConnection con = new SqlConnection(constr);
con.Open();
SqlCommand cmd = new SqlCommand("select * from tbl_addnewproduct where id=" + id, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.ExecuteNonQuery();
con.Close();
DataSet ds = new DataSet();
da.Fill(ds);
Image1.ImageUrl = ds.Tables[0].Rows[0][1].ToString();
Label1.Text = ds.Tables[0].Rows[0][2].ToString();
Label2.Text = ds.Tables[0].Rows[0][3].ToString();
}
*****this is gridview page********
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Width="237px">
<Columns>
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False"
ReadOnly="True" SortExpression="id" />
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<img alt ="" src ='images/<%#Eval("imagename") %>' height="50px" width="50px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<a href ='<%#"viewdeatil.aspx?id="+DataBinder.Eval(Container.DataItem,"id") %>'> <%#Eval("Name") %> </a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="product" HeaderText="product"
SortExpression="product" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:BussinessConnectionString %>"
SelectCommand="SELECT [id], [imagename], [Name], [product] FROM [tbl_addnewproduct]">
</asp:SqlDataSource>
</td></tr></table></div>
</div>
i want to show the gridview image in next page after click view button
but above code working but image is not show;
thanks sir