/*protected string BindImagesData(string _strtext, string SearchMode) * { * * string ImageTitle = string.Empty; * string ImageUrl = string.Empty; * string ImgUrlThumbformat = string.Empty; * string Imageid = string.Empty; * string Imagecaption = string.Empty; * string ImgArtist = string.Empty; * string ImgPreviewUrl = string.Empty; * string ImgCollectionid = string.Empty; * string ImgCollectionname = string.Empty; * * StringBuilder _maindiv = new StringBuilder(); * StringBuilder _innerdiv = new StringBuilder(); * string _strinnerhtml = string.Empty; * string _strhtml = string.Empty; * string _gettyimages = string.Empty; * string url = "http://admin.shoptweets.com/storify/gettyimages.aspx?searchterm=" + _strtext + "&searchmode=" + SearchMode + "&startindex=1"; * * StringBuilder str = new StringBuilder(); * * try * { * #region :: get all promotions from the url :: * HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(url)); * request.UserAgent = "slotsinc"; * request.Method = WebRequestMethods.Http.Get; * HttpWebResponse response = (HttpWebResponse)request.GetResponse(); * string Charset = response.CharacterSet; * StreamReader reader = new StreamReader(response.GetResponseStream()); * String responseString = reader.ReadToEnd(); * response.Close(); #endregion * var tempRecord = JsonConvert.DeserializeObject<List<RootObject>>(responseString); * foreach (RootObject rt in tempRecord) * { * int promotionid = 0; #region :: check duplicate promotion :: * if (rt.menu.items.Count > 0) * { * str.Append("<ul id='ul_image'>"); * for (int i = 0; i < rt.menu.items.Count; i++) * { * str.Append("<li data-name='" + dr["imagetitle"].ToString() + "' data-url='" + imageurl + "' data-bigurl='" + bigimageurl + "' id='" + dr["imageid"].ToString() + "'><img src='" + imageurl + "' border='0' width='200' height='200' /><input type ='checkbox' name = 'fcheck[]' value ='" + dr["imageid"].ToString() + "'></li>"); * } * str.Append("</ul>"); * } * //rt.menu.items[1]. * } * } * catch (Exception ex) * { * //Response.Write("<span style=' font-size: 3.2em; color: Red;'>" + ex.Message.ToString() + "</span>"); * } * return _gettyimages; * } */ public string LoadAllImages() { string allimages = string.Empty; DataSet ds = new DataSet(); StringBuilder str = new StringBuilder(); string imageurl = string.Empty; string bigimageurl = string.Empty; int r = 1; try { using (Signup objsignup = new Signup()) { int siteid = Convert.ToInt32(Session["signup_siteid"].ToString()); objsignup.NetworkID = Session["signup_networkid"].ToString(); ds = objsignup.GetsignupimageList(siteid); if (ds != null && ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { str.Append("<ul id='ul_image'>"); foreach (DataRow dr in ds.Tables[0].Rows) { DateTime dt = new DateTime(); dt = Convert.ToDateTime(dr["addedon"].ToString()); string date = dt.ToString("MMMM d, yyyy"); imageurl = ConfigurationSettings.AppSettings["baseurl"] + sitefldname + "/" + dr["imagedate"].ToString() + dr["imagename"].ToString(); bigimageurl = ConfigurationSettings.AppSettings["baseurl"] + sitefldname + "/" + dr["imagedate"].ToString() + "TN_" + dr["imagename"].ToString(); if (r == 1) { str.Append("<li class='li_selected' data-date='" + date + "' data-alt='" + dr["ImageAlttext"].ToString() + "' data-name='" + dr["imagetitle"].ToString() + "' data-url='" + imageurl + "' data-bigurl='" + bigimageurl + "' id='" + dr["imageid"].ToString() + "'><img src='" + imageurl + "' border='0' width='200' height='200' /><input type ='checkbox' name = 'fcheck[]' value ='" + dr["imageid"].ToString() + "'></li>"); id_image.Value = dr["imageid"].ToString(); idserver_image.Value = dr["imageid"].ToString(); id_imagesrc.Value = imageurl; id_imagesrcbig.Value = bigimageurl; txtdateuploaded.Text = date; txttitle.Text = dr["imagetitle"].ToString(); txtalttext.Text = dr["ImageAlttext"].ToString(); } else { str.Append("<li data-date='" + date + "' data-alt='" + dr["ImageAlttext"].ToString() + "' data-name='" + dr["imagetitle"].ToString() + "' data-url='" + imageurl + "' data-bigurl='" + bigimageurl + "' id='" + dr["imageid"].ToString() + "'><img src='" + imageurl + "' border='0' width='200' height='200' /><input type ='checkbox' name = 'fcheck[]' value ='" + dr["imageid"].ToString() + "'></li>"); } r++; } str.Append("</ul>"); } } else { } } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "gettyclasses signup uploadimageintemplate loadallimages", ex); } allimages = str.ToString(); return(allimages); }