i'm using this code for Json
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
jq(document).ready(function () {
var jq = jQuery.noConflict();
jq.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'About.aspx/bindBannerRepeater',
data: "{}",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
jq("#rep_banner").append("<li><img src=" + data.d[i].imgpath + "></li>");
}
},
error: function (result) {
alert("Error");
}
});
});
</script>
and this is html binding code
<ul class="slides">
<asp:Repeater ID="rep_banner" runat="server">
<ItemTemplate>
<li><a href="aboutus.html"> <img src='<%#Eval("imgpath") %>' alt="image is not Displayed" width="200px" height="200px" /></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
and this code in .cs file
[WebMethod]
public static bannertbl[] bindBannerRepeater()
{
DataTable dt = new DataTable();
List<bannertbl> details = new List<bannertbl>();
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
{
using (SqlCommand cmd = new SqlCommand("select * from bannertbl ", con))
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
foreach (DataRow dtrow in dt.Rows)
{
bannertbl Emp = new bannertbl();
Emp.bannerid =Convert.ToInt32(dtrow["bannerid"].ToString());
Emp.imgpath = dtrow["imgpath"].ToString();
Emp.page = dtrow["page"].ToString();
details.Add(Emp);
}
}
}
return details.ToArray();
}
My images are not coming , while i'm binding data.I'm not getting what to do?