You must Sign In to post a response.
  • Category: ASP.NET

    File upload is not retaining its path

    Hi friends ,

    Please help me to solve this

    I am creating 10 empty row in the grid to submit the rows dynamically at one shot using submit button

    DataRow dr;
    DataTable dt = new DataTable();
    for (int i = 1; i < 10; i++)
    {
    dr = dt.NewRow();

    dt.Rows.Add(dr);
    }
    dt.AcceptChanges();
    gvCustomers.DataSource = dt;
    gvCustomers.DataBind();

    In that i have one dropdownlist using that dropdownlist selected value the other one willl fill in tthe same grid and also one htmlinput file upload.. in first row no problem. when i select the second dropdownlist value then the first rows fhtmlinput file upload selected path will get vanished...

    Please help me to solve this by how to retain the old file upload path in the second row and soon...

    Thank you
  • #763686
    Hai Ambika,
    This is default behavior of file upload control that once the file is uploaded, the file path or the name will get vanished from the control. So you cant retain it.
    If you still want to show that path, you can better use the textbox and then assign the value to the textbox which will retains the data.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #763832
    You can handle this using hidden fields and java script.

    As soon as select the file you can store the file path in the hidden field. At the time of post you can read the particular files from the path and use that.

    By Nathan
    Direction is important than speed


Sign In to post your comments