none
Does a master page require a form tag RRS feed

  • Question

  • I wanted to place a form on an asp master page.
    The master page body in its simplest state looks like this.

    <body>

    <form id="form1" runat="server">
     <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
     </asp:ContentPlaceHolder>
    </form>

    </body>


    It is my understanding that you can not have a form within a form.

    As a work around, I removed the form tag and replaced it with a div tag like this:

    <body>

    <div id="divform1" runat="server">
     <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
     </asp:ContentPlaceHolder>
    </div>

    </body>

    and my final code looks like this:

    <body>

    <div id="divform1" runat="server">
     <form>
     </form>
     <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
     </asp:ContentPlaceHolder>
    </div>

    </body>

    It seems to work flawlessly. Are there any hidden problems doing this?

    A person asked a similar question on this forum but it went unanswered. Here the link:


    http://social.expression.microsoft.com/Forums/en-US/web/thread/c45fc801-a14f-48e6-aa87-073ec4b3d15c

     

    Wednesday, December 5, 2012 7:27 PM

All replies

  • The proper place to ask is the asp.net forum: http://forums.asp.net/

    I'll mention that you can't have two forms with runat="server" on the page at the same time, and you should have one of those (with all the active asp.net content inside it).  You can have other standard HTML forms. I have no idea why you need another form, since you didn't say.

    Wednesday, December 5, 2012 7:43 PM
  • That question possibly went unanswered because that is an ASP.NET question, not an Expression Web question.

    You'd be better off asking in the ASP.NET forum.

    A very few people here use ASP.NET, and EW's support for it is very, very basic (for most work you'd need VWD). You might get an answer, but you'd be better off on the ASP.NET forum.


    How many SEO experts does it take to change a lightbulb lightbulbs buy light bulbs neon lights sex porn.

    Wednesday, December 5, 2012 7:47 PM
  • ASP.net pages must have the asp.net form tag as shown in your first example. If you do not need You will get very unpredictable results if you try to use an html form element <form> in it. You need to use asp.net forms with asp.net pages. If you want to use some other type for forms processing why are you using asp.net pages? All asp.net pages are processed on the server before being sent to the browser.

    Free Expression Web Tutorials
    For an Expression Web forum with without the posting issues try expressionwebforum.com

    Wednesday, December 5, 2012 10:20 PM