protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated && Session["User"] == null) { Response.Redirect("~/Default.aspx?ReturnUrl=~" + Server.UrlEncode(Request.RawUrl)); } if (!IsPostBack) { lblError.Visible = false; lblError.InnerHtml = ""; //divPassword.Visible = true; if (Request.QueryString["guid"] != null) { Blog blog = new Blog(); try { txtBlogName.Enabled = false; DataTable dt = blog.getBlogsByBlogId(new Guid(Request.QueryString["guid"].ToString())); if (dt.Rows.Count > 0) { txtBlogName.Text = dt.Rows[0]["BlogName"].ToString(); txtDescribeFor.Text = dt.Rows[0]["DescribeFor"].ToString(); txtDescription.Text = dt.Rows[0]["Description"].ToString(); } } catch (Exception ex) { } finally { blog = null; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated && Session["User"] == null) { Response.Redirect("~/Default.aspx?ReturnUrl=~" + Server.UrlEncode(Request.RawUrl)); } if (!IsPostBack) { lblError.Visible = false; lblError.InnerHtml = ""; //divPassword.Visible = true; if (Request.QueryString["guid"] != null) { Blog blog = new Blog(); try { txtBlogName.Enabled = false; DataTable dt = blog.getBlogsByBlogId(new Guid(Request.QueryString["guid"].ToString())); if (dt.Rows.Count > 0) { txtBlogName.Text = dt.Rows[0]["BlogName"].ToString(); txtDescribeFor.Text = dt.Rows[0]["DescribeFor"].ToString(); txtDescription.Text = dt.Rows[0]["Description"].ToString(); if (dt.Rows[0]["ImagePath"] != null && !string.IsNullOrEmpty(dt.Rows[0]["ImagePath"].ToString())) { string virtualFolderName = ConfigurationManager.AppSettings["ImageFolderName"]; string rootPath = Server.MapPath("~/" + virtualFolderName); imgUploaded.Visible = true; imgUploaded.ImageUrl = string.Format(@"..\{0}\{1}", "UploadedImages", dt.Rows[0]["ImagePath"].ToString()); } } Featured objF = new Featured(); DataTable dtF = objF.getFeaturedByBlogId(); if (dtF.Rows.Count > 0) { if (dtF.Rows[0]["blogId"].ToString() == Request.QueryString["guid"].ToString()) { txtFeature.Text = dtF.Rows[0]["FeartureDescription"].ToString(); chkIsFeatured.Checked = true; dvFeature.Visible = true; } } } catch (Exception ex) { } finally { blog = null; } } } }