2017-02-04 6 views
0

メンバーの詳細情報を取得して登録するための検証書を作成しました。ユーザーが別のメンバーを追加してクリックすると、別のフォームを作成したいと思っています。 ASP.NETの1ページに2つのフォームタグを持つことは可能ですか?どのようにするのですか?ASP.NETでループを使用してチェックボックスのselectイベントで別のフォームを生成するにはどうすればよいですか?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="webAss1.WebForm4" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <style type="text/css"> 
     .auto-style1 { 
      width: 59%; 
     } 
     .auto-style2 { 
      width: 112px; 
     } 
     .auto-style3 { 
      width: 112px; 
      height: 29px; 
     } 
     .auto-style4 { 
      height: 29px; 
     } 
    </style> 
</head> 
<body> 
    <h2>MEMBER REGISTRATION FORM</h2> 
    <p> 
     Enter the details:</p> 
    <form id="form1" runat="server"> 
     <table class="auto-style1"> 
      <tr> 
       <td class="auto-style2">Name:</td> 
       <td> 
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td class="auto-style2">Email:</td> 
       <td> 
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td class="auto-style2">Contact no:</td> 
       <td> 
        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td class="auto-style3">Address:</td> 
       <td class="auto-style4"> 
        <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox> 
       </td> 
       <td class="auto-style4"></td> 
      </tr> 
      <tr> 
       <td class="auto-style2">&nbsp;</td> 
       <td> 
        <asp:CheckBox ID="CheckBox1" runat="server" /> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td class="auto-style2">&nbsp;</td> 
       <td> 
        <asp:Button ID="Button1" runat="server" Text="Button" /> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
     </table> 
    <div> 

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

あなたがあなたのページに別のサーバー側のフォームをテストする場合は、このエラーを取得します

+0

*ページにはサーバー側のフォームタグが1つしかない可能性があります* –

+0

他のメンバーを追加することはできませんか? @FarzinKanzi –

答えて

1

を助けてください:

A page can have only one server-side Form tag.

をしかし、あなたはrunat="serverせずに別のフォームを追加することができます。これはクライアント側の形式です。しかし、私はそれが役に立たないと思う。 (もちろんクライアント側のバリデーションは$("#form_id").valid();である)

関連する問題