public void Button1_Click(object sender, EventArgs e) { AdminDataManager ADMgr = new AdminDataManager(); bool doit = true; string name = "?"; string image = "?"; string description = "?"; try { name = this.TextBox1.Text.ToString(); image = this.FileUpload1.FileName.ToString(); description = this.TextBox3.Text.ToString(); if (name == "" || image == "" || description == "") { doit = false; } } catch (Exception lol) { doit = false; } if (doit) { string path = "~/Views/images/attractions"; FileUpload1.SaveAs(Server.MapPath(path) + "/" + image); ADMgr.createAttraction(name, image, description); DataTable dt = ADMgr.getAttractions(); GridView1.DataSource = dt; GridView1.DataBind(); } else { this.TextBox15.Text = "Error Encountered. Please try again."; } }