2014-03-13 162 views
0

ASP.NET網站在運行我的ASP.NET的網站在本地主機上我碰到下面的錯誤..在本地主機上的錯誤

Parser Error Message: The file '/MPage.master' does not exist. 

Line 1: <%@ page title="" language="VB" masterpagefile="~/MPage.master" autoeventwireup="false" inherits="Page1, App_Web_rscnlqny" %> 

我可以通過解決這個問題:

<%@ page title="" language="VB" masterpagefile="./MPage.master" autoeventwireup="false" inherits="Page1, App_Web_rscnlqny" %> 

但這樣做之後我得到的錯誤:

Parser Error Message: Could not load the assembly 'App_Web_hipf5z3e'. Make sure that it is compiled before accessing the page. 

Line 1: <%@ master language="VB" inherits="MPage, App_Web_hipf5z3e" %> 

我該如何解決這個問題?

回答

0

這也可能發生在您執行預編譯的aspx頁面並將其編輯爲未編譯狀態時,如將其從Live服務器複製並覆蓋您的開發/工作版本。

<%@Page />標籤內的aspx頁面的第一行,你可能會看到這樣一個屬性:

inherits="yourPageClass, App_Web_hipf5z3e". 

刪除App_Web_XXXX部分並添加屬性的CodeFile指向你的代碼隱藏文件:

CodeFile="yourPageFile.aspx.cs" 

新建答案:

You can mix C# and VB in the same project...but not the same page.

編輯的Web.config

<compilation debug="false"> 
    <codeSubDirectories> 
     <add directoryName="VBCode"/> 
     <add directoryName="CSCode"/> 
    </codeSubDirectories> 
</compliation> 
+0

現在,我得到:分析器錯誤信息:文件的代碼的語言是與頁面的語言不一致。 第1行:<%@ master language =「VB」inherits =「MPage」CodeFile =「MPage.master.cs」%> – user3403665

+0

如何在同一頁面添加c#和vb ..檢查我更新的答案.. – Rahul

+0

我沒有使用任何C#,只是vb在 – user3403665