Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 142871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:00:20+00:00 2026-05-11T08:00:20+00:00

I have a standard aspx page with which I need to add another standard

  • 0

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> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:00:20+00:00Added an answer on May 11, 2026 at 8:00 am

    It’s an interesting problem. Ideally you only want the 1 form tag on the page as other users have mentioned. Potentially you could post the data via javascript without having 2 form tags.

    Example taken from here, modified for your needs. Not 100% sure if this will work for you but I think this is how you’ll have to approach it.

    <html xmlns='http://www.w3.org/1999/xhtml' > <head runat='server'> <title>Untitled Page</title> <script type='text/javascript'>  function postdata() {    var fieldValue = document.getElementById('field1').value;    postwith('http://someothersite.com',{field1:fieldValue}); }  function postwith (to,p) {   var myForm = document.createElement('form');   myForm.method='post' ;   myForm.action = to ;   for (var k in p) {     var myInput = document.createElement('input') ;     myInput.setAttribute('name', k) ;     myInput.setAttribute('value', p[k]);     myForm.appendChild(myInput) ;   }   document.body.appendChild(myForm) ;   myForm.submit() ;   document.body.removeChild(myForm) ; }  </script> </head> <body> <form id='form1' runat='server'> <div>            <div>                 <input type='text' id='field1' name='field1' />                 <asp:Button ID='btnSubmitSubscribe' runat='server' Text='Submit' OnClientClick='postdata(); return false;' />         </div>  </div> </form> </body> </html> 

    If javascript is not a viable option – you can use .Net’s HttpWebRequest object to create the post call in code behind. Would look something like this in the code behind (assuming your text field is an asp textbox:

    private void OnSubscribeClick(object sender, System.EventArgs e) { string field1 = Field1.Text;   ASCIIEncoding encoding=new ASCIIEncoding(); string postData='field1='+field1 ; byte[]  data = encoding.GetBytes(postData);  // Prepare web request... HttpWebRequest myRequest =   (HttpWebRequest)WebRequest.Create('http://someotherwebsite/'); myRequest.Method = 'POST'; myRequest.ContentType='application/x-www-form-urlencoded'; myRequest.ContentLength = data.Length; Stream newStream=myRequest.GetRequestStream(); // Send the data. newStream.Write(data,0,data.Length); newStream.Close(); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web form page Default.aspx, which inherits from a BasePage class that
I have an aspx page which is checking Request.IsSecureConnection to ensure it is true,
I have an aspx page with 1 table containing 2 rows: <!DOCTYPE html PUBLIC
I have a standard button in my default.aspx page. <asp:Button ID=Search_Button runat=server Text=Search onclick=Search_Button_Click
I have a standard HTML page with an CKEditor on it wrapped in a
I have a standard MOSS 2007 Web Site (MOSS Terminology: Application and a SiteCollection)
I have a standard textbox and I've got jQuery on the page. I want
I have a standard ASP.NET 2.0 web page with a Delete button on it.
Let's say I have an ASP.NET web application. I create an aspx page that
I have a content page which has a related master page. I register a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.