Author: uyaem | Posted on: 9/28/2009 12:01:48 AM | Views : 290

As you all know, styling the regular <input type="file"> file upload control is a pain and only partially possible, so for my web application I followed a common approach:
<head> ... function showFileSelector() { var fileControl = document.getElementById("myFile"); fileControl.click(); return false; } function getFileAndPath() { var textBox = document.getElementById("tbxFile"); var fileControl = document.getElementById("myFile"); textBox.value = fileControl.value; } </head> <body> <form id="myForm"> ... <input type="file" id="myFile" runat="server" style="display: none;" onchange="getFileAndPath();" /> <asp:TextBox id="tbxFile" Runat="server" Width="200px" /> <asp:Button id="btnSelect" Runat ...

Go to the complete details ...