here is my code in which i wnt to display image base on click from database bit i am not able to get my image.
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script type="text/javascript">
$(function () {
$('#menu ul li a').click(function () {
var selectedLink = $(this)[0].innerHTML
localStorage.setItem('selectedLink', selectedLink);
});
});
window.onload = function () {
$('#menu ul li a').each(function () {
if ($(this)[0].innerHTML == localStorage.getItem('selectedLink')) {
$(this).attr('style', 'background-color:deeppink');
localStorage.removeItem('selectedLink');
}
else {
$(this).attr('style', 'background-color:none');
}
});
}
</script>
<style>
</style>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="container">
<div id="menu">
<ul class="nav navbar-nav navbar-left">
<li class="active">
<asp:LinkButton ID="lnkAllProducts" CssClass="btn btn-block" Text="All Products"
runat="server" onClick="BindImages" />
</li>
<li>
<asp:LinkButton ID="lnkBestSellers" CssClass="btn btn-block" Text="Best Sellers"
runat="server" />
</li>
<li>
<asp:LinkButton ID="lnkNewestAdded" CssClass="btn btn-block" Text="Newest Added"
runat="server" />
</li>
</ul>
</div>
<br />
<br />
<br />
<div id="product" runat="server">
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void BindImages(object sender, EventArgs e)
{
clsGallery objpp = new clsGallery(true);
// objProduct.getProduct();
objpp.getCatPro();
string str = string.Empty;
int j = 0;
for (j = 0; j < objpp.ListclsGallery.Count; j++)
{
// string path = objProduct.ListclsProductMain[i].ProductID+".jpg";
if (File.Exists(Server.MapPath("Backoffice/images/Category/" + objpp.ListclsGallery[j].GalleryID + ".jpg")))
{
str += @"<div class='row col-md-3 col-xs-6 hovereffect'>
<img class='imges' style='height:220px;' src='Backoffice/images/Category/" + objpp.ListclsGallery[j].GalleryID + ".jpg" + @"' />
</div>";
}
}
//}
product.InnerHtml = str;
}
}