void Admin_PhotoGallery_LoadComplete(object sender, EventArgs e) { main_class m = new main_class(); DataTable dt = m.displayImages(); //dt.Columns.Add("Image_toshare"); //for (int i = 0; i < dt.Rows.Count; i++) //{ // dt.Rows[i]["image_toshare"] = Path.GetFileName(dt.Rows[i]["image_path"].ToString()); ; //} Image_Results.DataSource = dt; Image_Results.DataBind(); }
protected void Image_Results_RowDeleting(object sender, GridViewDeleteEventArgs e) { main_class m = new main_class(); string i = Image_Results.Rows[e.RowIndex].Cells[0].Text; string deleterow = string.Format("delete from PhotoGallery where PhotoGallery_Id = {0}", i); SqlCommand delete_cmd = new SqlCommand(deleterow, m.cn); delete_cmd.ExecuteNonQuery(); Image_Results.DataSource = m.displayImages(); m.cn.Close(); m= null; i = null; delete_cmd.Dispose(); }
void Admin_upload_Photos_LoadComplete(object sender, EventArgs e) { if (Session.Count == 0) { Response.Redirect("Admin_Login.aspx"); } else { string User = Session["admin"].ToString(); main_class m = new main_class(); Image_Results.DataSource = m.displayImages(); Image_Results.DataBind(); } }