0

How to create in if statement on an aspx page?

I need create form at the first launch and the following are different:

<body>
     <% if (!Page.IsPostBack )

           {%>

      <form id="Form1" runat="server">

         <%}

         else 

           {%>

           <form id="Form1" runat="server" action="Page.aspx" method="post">

         <%}%>

     </form>
</body>
Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111

1 Answers1

0

You can have multiple forms, it's just only one form may have the runat="server" attribute.

https://stackoverflow.com/a/91374/3134112

ElasticCode
  • 7,311
  • 2
  • 34
  • 45