Using embedded standard HTML forms with ASP.NET

Posted by RM on Stack Overflow See other posts from Stack Overflow or by RM
Published on 2009-02-26T03:32:35Z Indexed on 2010/06/09 20:12 UTC
Read the original article Hit count: 426

Filed under:
|
|

I have a standard aspx page with which I need to add another standard HTML form into and have it submit to another location (external site), however whenever I press the submit button the page seems to do a post back rather than using the sub-forms action url.

A mock up of what the form relationships is below. Note in the real deployment the form will be part of a content area of a master page layout, so the form needs to submit independantly from the master page form.

    <html xmlns="http://www.w3.org/1999/xhtml" >
       <head runat="server">
          <title>Untitled Page</title>
       </head>
       <body>
           <form id="form1" runat="server">
           <div>
               <form id="subscribe_form" method="post" action="https://someothersite.com" name="em_subscribe_form" > 
                    <input type="text" id="field1" name="field1" />
                    <input id="submitsubform" type="submit" value="Submit" />
               </form>
           </div>
           </form>
       </body>
   </html>

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about html