2017-01-27 96 views
0

我正在開發一個項目,每當我嘗試加載這個頁面時,每次都會給我一樣的錯誤。 Project正在Visual Studio 2015中工作。目標是用戶可以填寫他們的姓名,電子郵件和他們想要發送給站點所有者的消息。只要用戶完成了消息,他們就會點擊按鈕,文本爲verzenden的按鈕,並且如果消息發送正確,消息如下所示。問題不在於代碼,我可以自己管理。我的Asp.net頁面不想加載

Design view

HTML代碼,這是所有包裹在一個的ContentPlaceHolder,因爲我已經做該項目的母版:

<form id="Form1" runat="server"> 
    <table> 
     <tr> 
      <td> 
       <br /> 
      <br /> 
      <h1>&nbsp;&nbsp; Stuur ons een berichtje</h1> 
      <br /> 
      <br /> 
      <p>Alle berichtjes worden ook verstuurd naar [email protected] Als het correct is verstuurd ontvangt u een bevestigingsmail.</p> 
      <br /> 
      <br /> 
      <asp:Label ID="lblnaam" runat="server" Text="Naam: "></asp:Label> 
      <asp:TextBox ID="txtnaam" runat="server"></asp:TextBox> 
      <asp:Label ID="lblmail" runat="server" Text="Emailadres: "></asp:Label> 
      <asp:TextBox ID="txtmail" runat="server"></asp:TextBox> 
      <br /> 
      <br /> 
      <asp:Label ID="lblbericht" runat="server" Text="Bericht: "></asp:Label> 
      <br /> 
      <br /> 
      <asp:TextBox ID="txtbericht" runat="server" Height="200px" Width="750px"></asp:TextBox> 
      <br /> 
      <br /> 
      <br /> 
      <asp:Button ID="btnVerzend" runat="server" Text="Verzenden" /> 
      <br /> 
      <br /> 
      <br /> 
      <asp:Label ID="lblres" runat="server" Text="Label" Visible="False"></asp:Label> 
      <br /> 
      <br /> 
      <br /> 
      </td> 
     </tr> 
    </table> 
</form> 

翻譯:一頁只能有一個表單標籤與RUNAT服務器

Translation: One page can only have one form-label with runat server

+1

[每頁旁路ASP.NET的一個RUNAT服務器外形(的可能的複製http://stackoverflow.com/questions/14295720/bypassing-asp-nets-one-runat-server-form-per-頁) –

回答

0

檢查母版的<form>標籤與runat="server"。 ASP.NET只允許每個頁面中有一個。

您可以從上面的代碼中刪除它;

<table> 
     <tr> 
      <td> 
       <br /> 
      <br /> 
      <h1>&nbsp;&nbsp; Stuur ons een berichtje</h1> 
      <br /> 
      <br /> 
      <p>Alle berichtjes worden ook verstuurd naar [email protected] Als het correct is verstuurd ontvangt u een bevestigingsmail.</p> 
      <br /> 
      <br /> 
      <asp:Label ID="lblnaam" runat="server" Text="Naam: "></asp:Label> 
      <asp:TextBox ID="txtnaam" runat="server"></asp:TextBox> 
      <asp:Label ID="lblmail" runat="server" Text="Emailadres: "></asp:Label> 
      <asp:TextBox ID="txtmail" runat="server"></asp:TextBox> 
      <br /> 
      <br /> 
      <asp:Label ID="lblbericht" runat="server" Text="Bericht: "></asp:Label> 
      <br /> 
      <br /> 
      <asp:TextBox ID="txtbericht" runat="server" Height="200px" Width="750px"></asp:TextBox> 
      <br /> 
      <br /> 
      <br /> 
      <asp:Button ID="btnVerzend" runat="server" Text="Verzenden" /> 
      <br /> 
      <br /> 
      <br /> 
      <asp:Label ID="lblres" runat="server" Text="Label" Visible="False"></asp:Label> 
      <br /> 
      <br /> 
      <br /> 
      </td> 
     </tr> 
    </table>