Hello All,

any one can help me am new in this world

I am updating grid data by fetching it in textboxes through Dropdownlist1

I want when we select dropdownlist1's item then value will fetch in the textboxes so we can update it easily. Even it is updating well but its updating only after choosing all data in the textboxes and also image.
but i want single updation through textboxes but its not happening without selecting of all data including image also. Please help me

HTML Code :









       




       
           
           
           
           
       
       
           
           
           
           
       
       
           
           
           
           
       
       
           
           
           
           
       



           
           
           
           
       





           






       
           



           

       




Enter Hoarding ID:

 


               


                   Hoarding Size:


           

               
           

                 

                 

               


                    Hoarding Landmark:


           

                                    Width="220px">
           

                 

                 

                Hoarding Cost:

                                    Width="220px">
                   

                 

                 

                Available From:

                                    Width="220px">
                   

                 

                 

                Available To:

                                    Width="220px">
                   

                 

                 

               


                    Choose Image:
               


           









  

                 












           

                 







.CS code :



    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        //if (IsPostBack)


         if (DropDownList1.SelectedItem.Text != "--select--")
        {
            con.Open();
            SqlDataAdapter da = new SqlDataAdapter("select * from providers_post where h_id = '" + DropDownList1.SelectedItem.Value + "'", con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            DataTable dt = ds.Tables[0];
            TextBox1.Text = dt.Rows[0][3].ToString();
            TextBox2.Text = dt.Rows[0][6].ToString();
            TextBox3.Text = dt.Rows[0][7].ToString();
            TextBox4.Text = dt.Rows[0][9].ToString();
            TextBox5.Text = dt.Rows[0][14].ToString();


            ImageButton1.ImageUrl = dt.Rows[0][12].ToString();
            Session["img"] = ImageButton1.ImageUrl;


            Label2.Text = dt.Rows[0][12].ToString();


            con.Close();
        }
       else
         {
         }


    }






    protected void Button1_Click(object sender, EventArgs e)
    {
        con.Open();
        string i = DropDownList1.SelectedItem.Value;


        if (FileUpload1.HasFile)
        {
            if (FileUpload1.PostedFile.ContentLength < 2097152)  //actually it takes file size in byte so 2MB=2097152byte(1024*1024*2) and also put it in web configuration page under
            {
                try
                {
                    string s = FileUpload1.PostedFile.ContentLength + FileUpload1.FileName;


                    FileUpload1.SaveAs(Server.MapPath("~\\") + "images\\" + "hoarding\\" + s);
                    Label2.Text = "images\\" + "hoarding\\" + s;
                }
                catch (Exception ex)
                {
                    //Response.Write("");
                    Response.Write("Error: " + ex.Message);
                }
            }
            else
            {
                    Response.Write("");
            }


                    SqlCommand cmd = new SqlCommand("update providers_post set Size = '" + TextBox1.Text + "',Landmark = '" + TextBox2.Text + "',Cost = '" + TextBox3.Text + "', From_date = '" + TextBox4.Text + "', To_date='" + TextBox5.Text + "', hoarding_image='" + Label2.Text + "' where h_id = '" + i + "'", con);
                    SqlDataReader dr = cmd.ExecuteReader();
                    con.Close();
                    Response.Redirect("hoarding_edit.aspx");
                    //Response.Write("");                
        }
    }