E
Er bengaor
Hi.
I am trying to simulate the fileupload html control in order to use
different css styles in the editbox and button. To do this, I'm using a
hidden fileupload control and javascript. But when I first click the web
control button to send the file, the value of this hidden control is
deleted without doing the postback to the server. Does anybody knows
what it happens? Thank you in advance.
This is my code:
<asp:TableRow>
<asp:TableCell>
<input id="txtImagePreview" runat="server"
type="file" style="DISPLAY: none"
onchange="javascript:document.getElementById('output').value =
this.value;">
<input type="text" id="output" class="editor">
<input class="botones" type="button" value="Browse"
onClick="javascript:document.getElementById('txtImagePreview').click()"
style="height: 20px; width: 56px;">
</asp:TableCell>
<asp:TableCell HorizontalAlign="Left">
<asp:Button runat="server" Width="56px" ID="btnUploadFile"
height="20px"
Text="Upload" CssClass="botones"></asp:Button>
</asp:TableCell>
</asp:TableRow>
I am trying to simulate the fileupload html control in order to use
different css styles in the editbox and button. To do this, I'm using a
hidden fileupload control and javascript. But when I first click the web
control button to send the file, the value of this hidden control is
deleted without doing the postback to the server. Does anybody knows
what it happens? Thank you in advance.
This is my code:
<asp:TableRow>
<asp:TableCell>
<input id="txtImagePreview" runat="server"
type="file" style="DISPLAY: none"
onchange="javascript:document.getElementById('output').value =
this.value;">
<input type="text" id="output" class="editor">
<input class="botones" type="button" value="Browse"
onClick="javascript:document.getElementById('txtImagePreview').click()"
style="height: 20px; width: 56px;">
</asp:TableCell>
<asp:TableCell HorizontalAlign="Left">
<asp:Button runat="server" Width="56px" ID="btnUploadFile"
height="20px"
Text="Upload" CssClass="botones"></asp:Button>
</asp:TableCell>
</asp:TableRow>