I have a AjaxFileUpload control on my page which successfully uploads file when its default upload button is clicked.
Later on, I thought of adding a textbox which would show the name of the file uploaded.
<asp:ScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ScriptManager><asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
OnUploadComplete="AjaxFileUpload1_OnUploadComplete"
MaximumNumberOfFiles="1"
AllowedFileTypes="pdf"/><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:TextBox ID="FileTxtBox" runat="server" /></ContentTemplate></asp:UpdatePanel>In codebehind,
protectedvoidAjaxFileUpload1_OnUploadComplete(object sender,AjaxFileUploadEventArgs file){string fileName =Path.GetFileNameWithoutExtension(file.FileName);FileTxtBox.Text= fileName;UpdatePanel1.Update();}
Do I need to do anything extra for the textbox to show the file? Please suggest.
Thank you