Two or more forms runat="server"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • havana7
    New Member
    • Jul 2007
    • 13

    Two or more forms runat="server"

    Hi

    I need to have two or more forms runat="server" in a aspx page but compiler returns me an error.

    Is it possible to do this?
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    An aspx page is a web form which is set to runat server by default via the page_load method. Not sure what you are trying to accomplish. Provide additional info.

    Nathan

    Comment

    • havana7
      New Member
      • Jul 2007
      • 13

      #3
      Thanx for the answer.

      Simply I need in the same page two forms: login form and (for example) registration form both runat="server".

      But I think it's impossible...

      Comment

      • radcaesar
        Recognized Expert Contributor
        • Sep 2006
        • 759

        #4
        No Its not possible.

        The .NET Framework doesn't allow multiple forms in a page.

        Comment

        • kenobewan
          Recognized Expert Specialist
          • Dec 2006
          • 4871

          #5
          There are three ways, one if only one form is runat server. The two others are described in this article and strictly speaking do not mean radcaesar is incorrect:
          Form-based Programming in ASP.NET

          Comment

          Working...