After Click on Save button ..Data is saving in database + Clear the Data in webpage ... Then - This is First Image
After I upload new image - Data is not Saving in Database ....This is Second image ....
if (FileTextAddsUpload.HasFile) ---Frist Time accepting true ..But Send time Saving the image ...It will displaying False
{
string FileName = Path.GetFileName(FileTextAddsUpload.PostedFile.FileName);
string exten = Path.GetExtension(FileName);
if (exten == ".png" || exten == ".PNG" || exten == ".jpg" || exten == ".JPG" || exten == ".jpeg" || exten == ".JPEG" || exten == ".gif" || exten == ".GIF")
{
FileTextAddsUpload.SaveAs(Server.MapPath("~/Images/" + FileName));
con.Open();
id++;
SqlCommand cmd = new SqlCommand("InsertTextAdd_SP", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@TextAddImagePath", "~/Images/" + FileName);
cmd.Parameters.AddWithValue("@MaxCharLength", txtEnterChar.Text);
cmd.Parameters.AddWithValue("@Price", id);
cmd.ExecuteNonQuery();
con.Close();
Imagetextadd.Visible = true;
FileTextAddsUpload.ID = null;
}
ClearControls();
}