<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<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 () {
var div = document.getElementById("product");
var div_position = document.getElementById("div_position");
var position = parseInt('<%=Request.Form["div_position"] %>');
if (isNaN(position)) {
position = 0;
}
div.scrollTop = position;
div.onscroll = function () {
div_position.value = div.scrollTop;
};
$('#menu ul li a').each(function () {
if ($(this)[0].innerHTML == localStorage.getItem('selectedLink')) {
$(this).attr('style', 'background-color:deeppink');
}
else {
$(this).attr('style', 'background-color:none');
if (localStorage.getItem('selectedLink') == null) {
$('[id*=lnkAllProducts]').attr('style', 'background-color:deeppink');
}
}
});
}
</script>
<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"
OnClick="BindAllImages" runat="server" />
</li>
<li>
<asp:LinkButton ID="lnkBestSellers" CssClass="btn btn-block" Text="ICON"
runat="server" OnClick="bindimages" />
</li>
<li>
<asp:LinkButton ID="lnkNewestAdded" CssClass="btn btn-block" Text="chandani sharama"
runat="server" />
</li>
</ul>
</div>
<br />
<br />
<br />
<div id="product" runat="server">
</div>
<input type="hidden" id="div_position" name="div_position" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div>
</div>
</div>
</asp:Content>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindImagesOnPageStart();
}
}
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";
string[] filePaths = Directory.GetFiles(Server.MapPath("~/Backoffice/Backoffice/images/Category/"));
int i = 0;
foreach (string filePath in filePaths)
{
string fileName = Path.GetFileName(filePath);
str += @"<div class='row col-md-3 col-xs-6 hovereffect'>
<div class='imageBackGround' style='width:250px;height:280px;'>
<div class='multiple-items'>
<div><div><img class='imges' src='Backoffice/Backoffice/images/Category/" + fileName + @"' /></div>
</div></div></div>";
i++;
}
product.InnerHtml = str;
}
}
public void BindImagesOnPageStart()
{
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/Gallery/" + objpp.ListclsGallery[j].GalleryID + ".jpg")))
{
str += @"<div class='row col-md-3 col-xs-6 hovereffect'>
<div class='imageBackGround' style='width:250px;height:280px;'>
<img class='imges' style='height:220px;' src='Backoffice/images/Gallery/" + objpp.ListclsGallery[j].GalleryID + ".jpg" + @"' />
</div>";
}
}
//}
product.InnerHtml = str;
}
protected void BindAllImages(object sender, EventArgs e)
{
BindImagesOnPageStart();
}
}
when i click on ICon it display me image like this and when i click on all nothing is display when i debug the code it is not going inside
public void BindImagesOnPageStart() this code is for All button please help