0
我有一個瀏覽按鈕,我需要瀏覽文件並保存it.i成功保存數據庫的路徑,但在編輯時,我無法獲取保存的路徑瀏覽按鈕textbox.so我該怎麼辦?如何在瀏覽按鈕文本框中顯示路徑
我的瀏覽器的代碼是這樣的:
![<asp:FileUpload ID="DocumentUpload" runat="server" /></td>][1]
我認爲代碼是這樣的:
![private void ViewDocumentInfo(int documentId)
{
try
{
TbldocumentmasterInfo cMaster = cmService.GetDocumentInfoById(documentId);
if (cMaster != null)
{
this.TxtEntryDate.Text = Common.DispDate(cMaster.Entrydate);
this.TxtDocumentName.Text = cMaster.Documentname;
this.TxtDocumentCode.Text = cMaster.Documentcode;
this.TxtDescription.Text = cMaster.Description;
//this.TxtPath.Text = cMaster.Fullpath;
//DocumentUpload.PostedFile.FileName.Substring(DocumentUpload.PostedFile.FileName.LastIndexOf("\\") + 1) = cmInfo.Fullpath;
this.DocumentUpload.HasFile.ToString() = cMaster.Fullpath;
this.DdlcategoryId.SelectedValue = Common.IsNull(cMaster.Categoryid);
this.TxtRemarks.Text = cMaster.Remarks;
}
if (documentId > 0)
{
this.btnSave.Text = "Update";
}
}
catch (Exception ex)
{
EM.ErrLog("DocumentMaster.aspx.cs", "ViewDocumentInfo", ex);
}
}][2]
[1]:
[2]: