This question is locked. New answers and comments are not allowed.
hello telerik
i am trying to insert the image to the telerik grid but i am unable to insert the image ican only able to show the image number not the image will you help me out on this
my code for inerting the image will be
on controoler:
public ActionResult _TemplatesClientSide(int Id)
{
var tst = new test
{
Id = Id,
};
if (TryUpdateModel(tst))
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlCommand cmd1 = new SqlCommand();
cmd1.CommandText = "Select country_img from tb_Country where country_Id=@country_Id";
cmd1.Connection = con;
cmd1.Parameters.AddWithValue("@country_Id", tst.country_Id);
cmd1.Parameters.AddWithValue("@country_img", tst.country_img);
cmd1.ExecuteNonQuery();
con.Close();
}
var tme = new db_TestEntities1();
ViewData["tb_TestMvc"] = tme.tb_Country.ToList();
return RedirectToAction("Index", "Home");
}
}
}
for index:
columns.Bound(p => p.Id)
.ClientTemplate("<img width='100' height='110' alt='<#=Id #>' src='"
+ Url.Content("../../Images/")
+ "<#=Id #>.jpg' />")
.Title("Picture");
i am trying to insert the image to the telerik grid but i am unable to insert the image ican only able to show the image number not the image will you help me out on this
my code for inerting the image will be
on controoler:
public ActionResult _TemplatesClientSide(int Id)
{
var tst = new test
{
Id = Id,
};
if (TryUpdateModel(tst))
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlCommand cmd1 = new SqlCommand();
cmd1.CommandText = "Select country_img from tb_Country where country_Id=@country_Id";
cmd1.Connection = con;
cmd1.Parameters.AddWithValue("@country_Id", tst.country_Id);
cmd1.Parameters.AddWithValue("@country_img", tst.country_img);
cmd1.ExecuteNonQuery();
con.Close();
}
var tme = new db_TestEntities1();
ViewData["tb_TestMvc"] = tme.tb_Country.ToList();
return RedirectToAction("Index", "Home");
}
}
}
for index:
columns.Bound(p => p.Id)
.ClientTemplate("<img width='100' height='110' alt='<#=Id #>' src='"
+ Url.Content("../../Images/")
+ "<#=Id #>.jpg' />")
.Title("Picture");