2011-09-06 6 views
7

私のasp.netソリューションを開いたばかりで、アプリケーションのすべてのコントロールでこのメッセージが表示されています。ここasp.netエラーコントロールの作成

は私のコードです:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="EnterData.DataEntry.WebForm1" %> 

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title></title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 


     <br /><table> 
       <tr> 
       <td> 
       lom_number: 
       </td> 
       <td><asp:TextBox ID="lom_numberTextBox" runat="server" 
        Text=''/></td> 

       <td>occurrence_date:</td> 
       <td><asp:TextBox ID="occurrence_dateTextBox" runat="server" 
        Text='<%# Bind("occurrence_date") %>' /> 

        <asp:MaskedEditExtender ID="MaskedEditExtender1" 
    TargetControlID="occurrence_dateTextBox" 
    Mask="99/99/9999" 
    MessageValidatorTip="true" 
    OnFocusCssClass="MaskedEditFocus" 
    OnInvalidCssClass="MaskedEditError" 
    MaskType="Date" 
    InputDirection="RightToLeft" 
    AcceptNegative="Left" 
    DisplayMoney="Left" 
    ErrorTooltipEnabled="True" runat="server"/></td> 
       <td>report_date:</td> 
       <td><asp:TextBox ID="report_dateTextBox" runat="server" 
        Text='<%# Bind("report_date") %>' /></td> 
        <td>spec_id:</td> 
       <td><asp:TextBox ID="spec_idTextBox" runat="server" Text='<%# Bind("spec_id") %>' /></td>    
        </tr> 
       <tr> 


       <td>batch_id:</td> 
       <td><asp:TextBox ID="batch_idTextBox" runat="server" 
        Text='<%# Bind("batch_id") %>' /></td> 
       <td>report_by:</td> 
       <td> 
       <asp:TextBox ID="report_byTextBox" runat="server" 
        Text='<%# Bind("report_by") %>' /></td> 

       <td>identified_by:</td> 


       <td><asp:TextBox ID="identified_byTextBox" runat="server" 
        Text='<%# Bind("identified_by") %>' /></td> 
       <td>problem:</td> 
       <td><asp:TextBox ID="problemTextBox" runat="server" Text='<%# Bind("problem") %>' /></td> 
       <td></td> 
       </tr></table> 
       <table><tr><td>section_c_issue_error_identified_by:</td> 
       <td> 
       <asp:TextBox ID="section_c_issue_error_identified_byTextBox" width="500" runat="server" 
        Text='<%# Bind("section_c_issue_error_identified_by") %>' /> 
        </td></tr> 
       <tr><td>section_c_comments:</td><td><asp:TextBox ID="section_c_commentsTextBox" Width="500" runat="server" 
        Text='<%# Bind("section_c_comments") %>' /></td></tr> 
       <tr><td>section_d_investigation:</td><td> 
       <asp:TextBox ID="section_d_investigationTextBox" runat="server" 
        Text='<%# Bind("section_d_investigation") %>' /></td></tr> 
       <tr><td>section_e_corrective_action:</td> <td><asp:TextBox ID="section_e_corrective_actionTextBox" runat="server" 
        Text='<%# Bind("section_e_corrective_action") %>' /></td></tr> 
       <tr><td>section_f_comments:</td><td><asp:TextBox ID="section_f_commentsTextBox" runat="server" 
        Text='<%# Bind("section_f_comments") %>' /></td></tr> 


       </table> 
     <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> 

    </div> 
    </form> 
</body> 
</html> 

誰もが私が間違っているのか知っていますか?

+0

デザインモードでは、エラー内でツールヒントには何が表示されますか? –

+0

@shredderそれのためのツールチップはありません –

+0

汚物と嘘! –

答えて

3

は、それはちょうど私に起こりました。私はページの名前を変更し、プロジェクトフォルダ内でaspxファイルを移動したときに起こったが、左のコードはunrenamedだった。

変更コード内から:

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

現在

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

にもすることにページタグで継承プロパティを編集します。

Inherits="Newfoldername_renamedname" 
2

このエラーを解決するには、以下の手順を実行します。このエラーの根本原因は、WebアプリケーションプロジェクトとIISの仮想ディレクトリ間のマッピングが正しくないことです。

次の手順に従って、このエラーを解決するには:

1 - 右クリック - あなたのWebアプリケーションプロジェクトを選択し、プロパティ - >ウェブ

2 - サーバーのセクションで使用IIS Webサーバーを選択してください - > [Create Virtual]をクリックします。

3-プロジェクトをクリーンアップし、再度コンパイルします。

完了:

この情報は以下のサイトにあります。ここで

http://weblogs.asp.net/hosamkamel/archive/2007/09/15/resolving-error-creating-control-xxx-in-web-application-project.aspx

は異なる解決策を提案し、使用前に初期化されないオブジェクトがある原因別の記事です。

http://blogs.msdn.com/b/webdevtools/archive/2010/05/06/another-error-creating-control-in-the-design-view-with-object-reference-not-set-in-visual-studio-2010.aspx

+0

これは動作しませんでした –

+0

私はこれを修正する方法がわからないように助けてください –

0

休館ASPXデザイナー、プロジェクトをきれいにそれを再構築すると、すべてが完璧に動作するようになりました。 (Visual Studio 2015を使用)

関連する問題