protected void Page_Load(object sender, EventArgs e) { string CatName = Request["CatName"]; string ConcatUrl = ""; int PageNo = 1; int PageSize = 25; CatName = CatName.Replace("-", " "); string strPageNo = Request["PageNo"]; if (strPageNo != "" && strPageNo != null) { PageNo = Convert.ToInt32(strPageNo); } if (!Page.IsPostBack) { lblHeader.Text = CatName.Replace("-", " "); BOLWallpapers WallpapersBOL = new BOLWallpapers(); int PageCount = WallpapersBOL.GetCount("", CatName) / PageSize + 1; rptWalls.DataSource = WallpapersBOL.GetWallpapers("", CatName, PageNo, PageSize); rptWalls.DataBind(); CatName = CatName.Replace(" ", "-"); ConcatUrl += ""; pgrToolbar.PageName = "~/Cats/" + CatName; pgrToolbar.PageNo = PageNo; pgrToolbar.PageCount = PageCount; pgrToolbar.ConcatUrl = ConcatUrl; pgrToolbar.PageBind(); } }
protected void Page_Load(object sender, EventArgs e) { string ConcatUrl = ""; int PageNo = 1; int PageSize = 25; string strPageNo = Request["PageNo"]; if (strPageNo != "" && strPageNo != null) { PageNo = Convert.ToInt32(strPageNo); } if (!Page.IsPostBack) { string Keyword = Request["Keyword"]; BOLWallpapers WallpapersBOL = new BOLWallpapers(); int PageCount = WallpapersBOL.GetCount(Keyword, "") / PageSize + 1; rptWalls.DataSource = WallpapersBOL.GetWallpapers(Keyword, "", PageNo, PageSize); rptWalls.DataBind(); ConcatUrl += "&Keyword=" + Keyword; pgrToolbar.PageNo = PageNo; pgrToolbar.PageCount = PageCount; pgrToolbar.ConcatUrl = ConcatUrl; pgrToolbar.PageBind(); } }
protected void Page_Load(object sender, EventArgs e) { int StartIndex = 0; int PageSize = 500; if (!string.IsNullOrEmpty(Request["SI"])) { StartIndex = Convert.ToInt32(Request["SI"]); } if (!string.IsNullOrEmpty(Request["PS"])) { PageSize = Convert.ToInt32(Request["PS"]); } BOLWallpapers WallpapersBOL = new BOLWallpapers(); rptWalls.DataSource = WallpapersBOL.GetAll(StartIndex, PageSize); rptWalls.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { ID = Request["ID"]; string NewSize = Request["NewSize"]; BOLWallpapers WallpapersBOL = new BOLWallpapers(); Wallpaper CurWallpaper = WallpapersBOL.GetDetailsByID(ID); if (CurWallpaper != null) { Page.Title = CurWallpaper.Title; ltrHeader.Text = CurWallpaper.Title; CatName = CurWallpaper.CatName.Replace(" ", "-"); TitleName = CurWallpaper.Title.Replace(" ", "-"); if (string.IsNullOrEmpty(NewSize)) { imgWallpaper.ImageUrl = "~/Wallpapers/" + CurWallpaper.FileFullPath; hplDownloadOriginal.NavigateUrl = "~/Wallpapers/" + CurWallpaper.OrgFile; } else { try { string[] NewSizeArray = NewSize.Split('x'); int NewWidth = Convert.ToInt32(NewSizeArray[0]); int NewHeight = Convert.ToInt32(NewSizeArray[1]); System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath("~/Wallpapers/" + CurWallpaper.FileFullPath)); Bitmap ResizeBM = ResizeImage(image, NewWidth, NewHeight); System.IO.MemoryStream ms = new MemoryStream(); ResizeBM.Save(ms, ImageFormat.Jpeg); byte[] byteImage = ms.ToArray(); var SigBase64 = Convert.ToBase64String(byteImage); // Get Base64 imgWallpaper.ImageUrl = "data:image/jpeg;base64," + SigBase64; hplDownloadOriginal.NavigateUrl = "data:image/jpeg;base64," + SigBase64; } catch { } } string AllResolutions = @"1366x768,1920x1080,360x640,1024x768,1600x900,1280x800,1440x900,1280x1024,800x600,1680x1050,2560x1440,320x480,1920x1200,480x800,720x1280,1080x1920"; string[] AllResArray = AllResolutions.Split(','); rptResolutions.DataSource = AllResArray; rptResolutions.DataBind(); ltrCategory.Text = "Category: " + CurWallpaper.CatName; hplCategory.NavigateUrl = "~/Cats/" + CurWallpaper.CatName.Replace(" ", "-") + "-1.html"; ltrDownloadTimes.Text = "Download Time: " + CurWallpaper.DownloadTime; hplOriginalSize.Text = "Original Size: " + CurWallpaper.OriginalSize; rptWalls.DataSource = WallpapersBOL.GetOthers(ID, CurWallpaper.CatName, 3); rptWalls.DataBind(); ltrOtherWallCats.Text = "Other wallpapers of " + CurWallpaper.CatName + " category"; Tools.SetMeta("description", CurWallpaper.Title); } }