2011-05-12 44 views
0

不是一個標籤名稱或文本框的ID我收到了許多這樣的錯誤作爲收到錯誤有關的上下文

The name 'lblThankYou' does not exist in the current context

然而,asp.net代碼有「lblThankYou」作爲標籤名稱

<asp:Label ID="lblThankYou" runat="server" Visible="False" Font-Bold Font-Size ="Medium" ><table><tr><td>Thank you for submitting your request. We will respond the following business day. 
         For immediate assistance, please call us at 1-800-xxx-xxxx.</tr></table></asp:Label> 

然而,當我嘗試預覽在瀏覽器中的文件,我得到這個

Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'xxxxxxxxxxxxSolution2010.Signup3'.

Source Error:

Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageLicensing.master" AutoEventWireup="true" CodeBehind="Signup3.aspx.cs" Inherits="xxxxxxxxxxxSolution2010.Signup3" %> Line 2: Line 3:

Source File: /Signup3.aspx Line: 1

奇怪的是與c頌歌是那裏的網頁,我試圖重建它解決它,但無濟於事

我使用ASP.net 4.0和Visual Studio 2010,是否可以幫助

+0

如果您正常運行Web應用程序(使用F5),會發生什麼情況? – ibram 2011-05-12 19:21:43

回答

0

那麼我修復它的方式是創建一個新的代碼文件並將現有的代碼複製到它並使用相同的舊文件名保存它。

修復了問題

+0

你有什麼理由導致錯誤? – 2011-05-18 17:40:23

+0

This.josh,我真的沒有一個關於它的理論對不起。我認爲這是與視覺工作室處理重建的方式有關,但我無法在互聯網上找到任何支持它的文檔。但是,它似乎是一種解決方法解決這個問題只是爲了防止有人對此感到頭疼 – 2011-05-18 17:51:22

0

你的表格單元格中缺少結束標記

+0

對不起,因爲我剛剛複製了部分代碼 – 2011-05-12 18:32:34

+0

您有一個開放的標記,並且下一個結束標記是標記。 ​​...查看上面的代碼片段。您粘貼到問題中的代碼可能會導致錯誤。 – 2011-05-12 19:20:35

相關問題