第一步,在page_Load事件中写入一下代码:
this.FileUpload1.Attributes.Add("onchange", "document.getElementById(\'" + txtFileUpload.ClientID + "\').value = this.value"); //FileUpload1 上传控件ID
//txtFileUpload 文本框ID
第二步,在上传事件中最后写入一下代码:
this.txtFileUpload.Text = sd.UpLoadFile(this.FileUpload1);