2
Answers

how can i get the value of the file upload control

imbet lugue

imbet lugue

14y
4k
1
how can i get the file upload control?? the file upload control is a child page and i want the value of it will display in a labelin a grdview as the parent page 
im using this code:

aspx page
<script type="text/javascript" langauge="javascript">
    function post_value() {
        var lblUpload = document.getElementById("upFile").value;
        window.opener.form1.upFile.value = lblUpload;
 
 
 window.close();
}
</script>

aspx.cs page

 protected void Button4_Click(object sender, EventArgs e)
        {
            if (upFile.HasFile)
            {
                upFile.SaveAs(Server.MapPath("upload_file") + @"\"  + upFile.FileName);
                Label1.Text = "File Uploaded: " + upFile.FileName;
                
            }
            else
            {
                Label1.Text = "No File Uploaded.";
            }
            this.Button4.Attributes.Add("onclick", "javascript:post_value()");
                
            

how can get the value of the the file upload control and send it to a label in a grid

plsss help me



Answers (2)