Kavi suja

Kavi suja

  • NA
  • 298
  • 171.7k

FileUpload - ImageButton - FilePath on ImageButton

Jul 8 2013 3:20 AM
Hi,
   I use Imagebutton as FileUpload Control using the following code.When i click on image,the popup for choosing file from local system will be shown.

<head runat="server">
  <title></title>
  <script type="text/javascript">
  function chooseFile() {
  document.getElementById("FileUpload1").click();
  }
  </script>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <div style="height: 0px; overflow: hidden">
  <asp:FileUpload ID="FileUpload1" runat="server" />
  </div>  
   <asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="chooseFile();" ImageUrl="btnlogin.png" />
  </div>
  </form>
</body>
</html>



Now I want to display the path of the selected file on imageButton after the file selected.Can anyone help me to do this?

Answers (6)