コード例 #1
0
        protected void GrdBlogList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int id = 0;

            if (e.CommandName == "Deleterec")
            {
                id = Convert.ToInt32(e.CommandArgument);
                int result = clsobj.DeleteLogobyId(id);
                FillGridData();
            }
            else if (e.CommandName == "Editrec")
            {
                id = Convert.ToInt32(e.CommandArgument);
                DataTable dt = new DataTable();
                dt                  = clsobj.GetLogobyId(id);
                txtName.Text        = dt.Rows[0]["Title"].ToString();
                hdnImg.Value        = dt.Rows[0]["ImageUrl"].ToString();
                imgbanner.ImageUrl  = "/admin/uploadfiles/" + dt.Rows[0]["ImageUrl"].ToString();
                txtDescription.Text = dt.Rows[0]["Description"].ToString();
                imgbanner.Visible   = true;
                FillGridData();
            }
            else
            {
                FillGridData();
            }
        }