Hello i got hidden FileUpload control, textBox where i wanna write url adrres or! filepath to some file, and button for call FileUpload. My problem is that i need instantly after user check in fileupload control some file and close popup window, fill TextBox with filepaths of that file. I know how show filepath but i need do it automatically and that trap for me. Here is what i got so far
<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>
protected void Page_Load(object sender, EventArgs e)
{
btnFileUpload.Attributes.Add(
"onclick",
"document.getElementById('" + FileUpload2.ClientID + "').click();");
}
So answer is simple: where should i put my check code for filling TextBox? something like this
if (FileUpload2.PostedFile != null)
{
TextBox2.Text = System.IO.Path.GetFullPath(FileUpload2.PostedFile.FileName);
}