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
  • 15,685
  • 16
  • 74
  • 107

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
  • 6,525
  • 2
  • 27
  • 41