I have a file upload in ASP.net to which I want to change the look and feel to be seen as bootstrap but since there is no direct conversion I have to use a button and a textbox to emulate its behavior, I have these elements
<asp:FileUpload ID="FileUpload1" runat="server"/>
<asp:Button ID="Button1" runat="server" Text="Button" CssClass="btn btn-default" />
<asp:TextBox ID="TextBox1" runat="server" CssClass="form-control"></asp:TextBox>
and I have this code to place in the TextBox1 the name of the file selected with FileUpload, but it is not working:
$(document).ready(function () {
$(document).on('change', '#<% FileUpload1.ClientID %>', function (e) {
$('#<% TextBox1.ClientID %>').val(e.target.files[0].name);)};
});
Does anyone know why this code does not work?