1
在我的asp.net應用程序中,我使用了Textbox
,button
和hidden fileupload control
。
按鈕時使用jQuery的單擊了我正在fileupload window
如下,從文件上傳窗口讀取文件名到文本框
protected void btn_browse_Click(object sender, EventArgs e)
{
StringBuilder strScript = new StringBuilder();
strScript.Append("$(document).ready(function(){");
strScript.Append("$('#FileUpload1').click();");
strScript.Append("});");
Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", strScript.ToString(), true);
txt_fileName.Text=FileUpload1.FileName;
}
我的問題是我無法顯示從fileupload
到textbox
選定的文件名。
文件名不顯示在textbox
任何暗示。