hi everyone.. am having problem saving the data from dropdownlist..it always store the first data of the dropdown list.. am using ajaxfileuploadd..plzz help
protected void AjaxFileUploadEvent(object sender, AjaxFileUploadEventArgs e)
{
if (!IsPostBack)
{
SqlConnection con = new SqlConnection();
string filepath = (Server.MapPath("~/property_images/") + Guid.NewGuid() + System.IO.Path.GetFileName(e.FileName));
AjaxFileUpload1.SaveAs(filepath);
string fl = filepath.Substring(filepath.LastIndexOf("\\"));
string[] split = fl.Split('\\');
string newpath = split[1];
string imagepath = "~/property_images/" + newpath;
string name = ddlPname.SelectedItem.Text;
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO tbl_pro_img(member_id, property_name, path) VALUES (@member_id, @pn, @IMAGE_PATH)", con);
cmd.Parameters.AddWithValue("@member_id", lblMember_id.Text);
cmd.Parameters.AddWithValue("@pn", name);
cmd.Parameters.AddWithValue("@IMAGE_PATH", newpath);
cmd.ExecuteNonQuery();
con.Close();
}
}