How to include multiple <forms> on one ASP.NET page

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to include multiple <forms> on one ASP.NET page

    Hi,

    I need to create an ASPX page that includes both traditional HTML Forms
    (which are submitted to a third-party site like a travel booking service)
    and also make use of the ASP.Net form. I've tried a number of approaches so
    far but none seem to really suffice:

    1. Position the HTML form elements absolutely and simply write the HTML
    after the </form> tag. This sort of works but then allows no server control
    over the creation of the form (i.e. setting the check-in date as today + 7)
    as all of the elements lack the 'runat=server' parameter.

    2. Make the HTML form submit to my IIS server and then simply prepare
    redirect to a URL with all of the form elements included (i.e. mimic a
    method=get form). This works (in some cases) but creates the most hideous
    URL's (and obviously is limited in length etc. etc. etc.)

    3. Submit the HTML form to my IIS server and then construct a POST query by
    hand. I'm not even sure if this is allowed, and seems like a nasty approach
    as it will involve unnecessary extra visits to my server.

    What I'd really like to do is have the secondary form as a custom Web
    Control so that it can be prepared at the server, customised according to
    dates etc. and then served to whichever page needs it. When the user clicks
    'submit' it would (preferably) submit directly to the third-party site.

    Does anyone have any ideas?

    Thanks in advance!

    Ben.

    mailto:ben@guidetotheworld.net


    Ben Turner Guest

  2. Similar Questions and Discussions

    1. How do I Include content (another page) in a WEeb [page
      I need some help. I?ve been using MS Front Page for the last 6-7 yrs. In MS FP there is a way to include an html file into another html file. ...
    2. Multiple Forms in one page
      Is there any way to have multiple forms in one page without having the forced space between the submit buttons that each form has? In other...
    3. Multiple forms on one page
      I am trying to put together a stripped-down online order form that allows a user to enter quantities ordered for a bunch of products, as well as...
    4. Every time i try to display records on an include page i get repeats of the whole include
      hi guys and ladies, here is my problem and i would be most grateful if any one could shed some light on this please: i have a default.asp page...
    5. [PHP] multiple FORMS on same page problem.
      I am creating a page with 2 buttons. One which will refresh the page and the other that will go to another page. My problem that I need to put all...
  3. #2

    Default Re: How to include multiple <forms> on one ASP.NET page

    If you are submitting the form using a button named Button1, you can
    add the following code to Page Load event to submit your form directly
    to Hotmail site.

    Button1.Attributes.Add("onClick",
    "Form1.action='http://www.hotmail.com';Form1.Submit;")

    You don't need to create a custom control to submit a server form to a
    third party site.

    Thanks
    Ram


    "Ben Turner" <ben@guidetotheworld.net> wrote in message news:<Tu2Wa.2272$bo1.1409@news-server.bigpond.net.au>...
    > Hi,
    >
    > I need to create an ASPX page that includes both traditional HTML Forms
    > (which are submitted to a third-party site like a travel booking service)
    > and also make use of the ASP.Net form. I've tried a number of approaches so
    > far but none seem to really suffice:
    >
    > 1. Position the HTML form elements absolutely and simply write the HTML
    > after the </form> tag. This sort of works but then allows no server control
    > over the creation of the form (i.e. setting the check-in date as today + 7)
    > as all of the elements lack the 'runat=server' parameter.
    >
    > 2. Make the HTML form submit to my IIS server and then simply prepare
    > redirect to a URL with all of the form elements included (i.e. mimic a
    > method=get form). This works (in some cases) but creates the most hideous
    > URL's (and obviously is limited in length etc. etc. etc.)
    >
    > 3. Submit the HTML form to my IIS server and then construct a POST query by
    > hand. I'm not even sure if this is allowed, and seems like a nasty approach
    > as it will involve unnecessary extra visits to my server.
    >
    > What I'd really like to do is have the secondary form as a custom Web
    > Control so that it can be prepared at the server, customised according to
    > dates etc. and then served to whichever page needs it. When the user clicks
    > 'submit' it would (preferably) submit directly to the third-party site.
    >
    > Does anyone have any ideas?
    >
    > Thanks in advance!
    >
    > Ben.
    >
    > mailto:ben@guidetotheworld.net
    Ram Guest

  4. #3

    Default Re: How to include multiple <forms> on one ASP.NET page

    You can check out this article, it might help you
    [url]http://msdn.microsoft.com/msdnmag/issues/03/05/CuttingEdge/[/url]


    --
    Saravana
    Microsoft India Community Star,MC**
    [url]www.ExtremeExperts.com[/url]



    "Ben Turner" <ben@guidetotheworld.net> wrote in message
    news:Tu2Wa.2272$bo1.1409@news-server.bigpond.net.au...
    > Hi,
    >
    > I need to create an ASPX page that includes both traditional HTML Forms
    > (which are submitted to a third-party site like a travel booking service)
    > and also make use of the ASP.Net form. I've tried a number of approaches
    so
    > far but none seem to really suffice:
    >
    > 1. Position the HTML form elements absolutely and simply write the HTML
    > after the </form> tag. This sort of works but then allows no server
    control
    > over the creation of the form (i.e. setting the check-in date as today +
    7)
    > as all of the elements lack the 'runat=server' parameter.
    >
    > 2. Make the HTML form submit to my IIS server and then simply prepare
    > redirect to a URL with all of the form elements included (i.e. mimic a
    > method=get form). This works (in some cases) but creates the most hideous
    > URL's (and obviously is limited in length etc. etc. etc.)
    >
    > 3. Submit the HTML form to my IIS server and then construct a POST query
    by
    > hand. I'm not even sure if this is allowed, and seems like a nasty
    approach
    > as it will involve unnecessary extra visits to my server.
    >
    > What I'd really like to do is have the secondary form as a custom Web
    > Control so that it can be prepared at the server, customised according to
    > dates etc. and then served to whichever page needs it. When the user
    clicks
    > 'submit' it would (preferably) submit directly to the third-party site.
    >
    > Does anyone have any ideas?
    >
    > Thanks in advance!
    >
    > Ben.
    >
    > mailto:ben@guidetotheworld.net
    >
    >

    Saravana Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139