2013-03-19 177 views
0

我工作在我的大學項目社交網站.....有一些關鍵的問題聽到.... - >當我拖動一個下拉按鈕或圖像按鈕那裏頁面運行很容易但雙擊它後aspx.cs頁面打開沒有代碼賴特仍然頁面顯示CS1061-錯誤。asp.net c#編譯器錯誤CS1061

點擊按鈕後產生的點擊事件....

namespace newsns 
{ 
    public partial class WebForm6 : System.Web.UI.Page 
    { 
     protected void Page_Load(object sender, EventArgs e) 
     { 

     } 

     protected void Button1_Click1(object sender, EventArgs e) 
     { 

     } 
    } 
} 

- >有任何類沒有問題的任何命名空間......或任何代碼....所以爲什麼瀏覽器顯示這條消息

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.forgotpassword_aspx' does not contain a definition for 'Button1_Click1' and no extension method 'Button1_Click1' accepting a first argument of type 'ASP.forgotpassword_aspx' could be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 331:   Line 332:
Line 333: Text="Button" /> Line 335:

Source File: c:\Users\DHAVAL\Documents\Visual Studio 2010\Projects\NEWSNS\newsns\forgotpassword.aspx Line: 333

顯示詳細的編譯器輸出:

顯示完整的編譯來源:

- >那裏我的一些頁面不能顯示這個錯誤,但其他頁面顯示它....爲什麼... ????? 請回答我的問題....我新的C#asp.net ...我失去了我的更多時間來尋找解決方案...

我嘗試所有方法來解決問題....但它仍然讓我難堪。

+0

「ASPX」文件後面的代碼可能沒有正確設置。檢查ASPX頁面頂部的<%@ Page指令中的'CodeBehind'屬性。該文件名是否與你的例子中代碼的位置相匹配? – 2013-03-19 17:20:54

+0

所有的代碼設置正確......文件名,類名,名稱空間都匹配正確...當我創建項目一些頁面工作很好,但現在添加新頁面也相同error.i檢查大多數網站相關的這個話題沒有一個人可以正確回答它。 – user2154272 2013-03-19 18:43:25

+0

請問您可以粘貼忘記密碼.aspx的代碼 – 2013-04-13 11:25:10

回答

0

我認爲,如果你重新構建應用程序解決了這個問題

,如果你使用任何ASP的控制,必須重新部署應用或Web應用程序來查找相關的DLL文件到bin文件夾。

祝你好運

0

同樣的錯誤,我不得不忍受和解決它。原因如下: 如果您忘記了任何{}或如果您使用任何邏輯操作符,請通過將其更改爲>或<進行正確檢查。你會很快解決這個問題。