protected void Page_Load(object sender, EventArgs e) { btnFileUpload.Attributes.Add( "onclick", "document.getElementById('" + FileUpload2.ClientID + "').click();"); }
<div class="ViewContent"> <asp:FileUpload ID="FileUpload2" runat="server" Width="317px" style="display: none"/> <input id="btnFileUpload" type="button" value="Add" runat="server" style="width: 70px" /> <asp:TextBox ID="TextBox2" runat="server" Width="310px"/> </div>
if (FileUpload2.PostedFile != null) { TextBox2.Text = System.IO.Path.GetFullPath(FileUpload2.PostedFile.FileName); }