protected void FormViewJob_ItemCommand(object sender, FormViewCommandEventArgs e) { if (e.CommandName == "upload") { if (((FileUpload)(FormViewJob.FindControl("FileUploadJob"))).HasFile) { string fname = ((FileUpload)FormViewJob.FindControl("FileUploadJob")).FileName; ((FileUpload)FormViewJob.FindControl("FileUploadJob")).SaveAs(Server.MapPath("~/App_Themes/Theme1/") + fname); ((Image)FormViewJob.FindControl("Image2")).ImageUrl = "~/App_Themes/Theme1/" + fname; byte[] photo = ((FileUpload)(FormViewJob.FindControl("FileUploadJob"))).FileBytes; Session["logo"] = photo; //File.Delete("~/App_Themes/Theme1/" + fname); } } }
private void ViewJobDetails(Job job) { FormViewJob formViewJob = new FormViewJob(job); formViewJob.ShowDialog(); }