我用一些菜單項定義一個母版頁。即時通訊使用文件上傳控制,我只是有一個問題,顯示文件的內容,以打開它的另一個內容頁:newModel.aspx頁面。它的工作將但我不能顯示內容,即時獲取錯誤: 找不到文件'C:\ Program Files(x86)\ Common Files \ Microsoft Shared \ DevServer \ 10.0 \ C%3a%5cUsers%5chhassan%5cDocuments% 5cVisual +工作室+ 2010%5cWebSites%5cKBD-2013%5cModel%5cTest.edd」。找不到文件'C: Program Files(x86) Common Files Microsoft Shared DevServer 10.0'
C#母版代碼:
protected void Open_btn_click(object sender, EventArgs e)
{
bool fileOK = false;
string SampleDocuments = Server.MapPath(string.Empty);
if (FileUploadCtrl.HasFile)
{
string fileExtension = System.IO.Path.GetExtension(FileUploadCtrl.FileName).ToLower();
string allowedExtension = ".edd";
if (fileExtension == allowedExtension)
{
fileOK = true;
}
}
if (fileOK == true)
{
string fileName = SampleDocuments + "\\Model" + "\\" + FileUploadCtrl.FileName;
Response.Redirect("~/Model/newModel.aspx?fileName=" + fileName);
}
newModel,並向頁面代碼:
protected void Page_Load(object sender, EventArgs e)
{
String fileName = HttpUtility.UrlEncode(Request.QueryString["fileName"]);
this.DiagramWebControl1.LoadBinaryDocument(fileName);
}
我的應用程序運行在本地主機 –
但你使用IIS?還是IIS開發服務器? –
對不起,我忘了用IIS編寫它 –