Post a form (server side) and submit to external url

Discussion in 'ASP .Net' started by Gert, Nov 4, 2005.

  1. Gert

    Gert Guest

    Hi,

    I have a form (server side) because of the filling of variables through the
    application. But now I need to post it to an url on submit.
    My .HTML form looks like this, but how to translate it to asp.net vb code?

    !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    <form action="https://multipay.net/transaction/mpmain.php" method="post">

    ....

    <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">

    I saw messages about doing a client side javascript as action for onsubmit.
    This is not clear to be and seems not the right way.



    Thanks,

    Gert
    Gert, Nov 4, 2005
    #1
    1. Advertising

  2. Gert s this not php?
    Are you in the right group?


    "Gert" <> wrote in message
    news:eZX##...
    > Hi,
    >
    > I have a form (server side) because of the filling of variables through

    the
    > application. But now I need to post it to an url on submit.
    > My .HTML form looks like this, but how to translate it to asp.net vb code?
    >
    > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    > <form action="https://multipay.net/transaction/mpmain.php" method="post">
    >
    > ...
    >
    > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    >
    > I saw messages about doing a client side javascript as action for

    onsubmit.
    > This is not clear to be and seems not the right way.
    >
    >
    >
    > Thanks,
    >
    > Gert
    >
    >
    Patrick.O.Ige, Nov 4, 2005
    #2
    1. Advertising

  3. Gert

    Mr Newbie Guest

    You cant simply post a form to an ASP.NET webserver. You need to create a
    webform and GET the webform, flll in the fields and then postback the form
    to the server.

    --
    Best Regards

    The Inimitable Mr Newbie º¿º


    "Gert" <> wrote in message
    news:eZX%23%...
    > Hi,
    >
    > I have a form (server side) because of the filling of variables through
    > the application. But now I need to post it to an url on submit.
    > My .HTML form looks like this, but how to translate it to asp.net vb code?
    >
    > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    > <form action="https://multipay.net/transaction/mpmain.php" method="post">
    >
    > ...
    >
    > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    >
    > I saw messages about doing a client side javascript as action for
    > onsubmit. This is not clear to be and seems not the right way.
    >
    >
    >
    > Thanks,
    >
    > Gert
    >
    >
    Mr Newbie, Nov 4, 2005
    #3
  4. Gert

    Mr Newbie Guest

    He is asking how to translate his form to ASP.NET Webform I think.

    --
    Best Regards

    The Inimitable Mr Newbie º¿º


    "Patrick.O.Ige" <> wrote in message
    news:...
    > Gert s this not php?
    > Are you in the right group?
    >
    >
    > "Gert" <> wrote in message
    > news:eZX##...
    >> Hi,
    >>
    >> I have a form (server side) because of the filling of variables through

    > the
    >> application. But now I need to post it to an url on submit.
    >> My .HTML form looks like this, but how to translate it to asp.net vb
    >> code?
    >>
    >> !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    >> <form action="https://multipay.net/transaction/mpmain.php" method="post">
    >>
    >> ...
    >>
    >> <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    >>
    >> I saw messages about doing a client side javascript as action for

    > onsubmit.
    >> This is not clear to be and seems not the right way.
    >>
    >>
    >>
    >> Thanks,
    >>
    >> Gert
    >>
    >>

    >
    >
    Mr Newbie, Nov 4, 2005
    #4
  5. Good you understood that Mr Newbie.
    I was confused.
    Patrick

    "Mr Newbie" <> wrote in message
    news:...
    > You cant simply post a form to an ASP.NET webserver. You need to create a
    > webform and GET the webform, flll in the fields and then postback the form
    > to the server.
    >
    > --
    > Best Regards
    >
    > The Inimitable Mr Newbie º¿º
    >
    >
    > "Gert" <> wrote in message
    > news:eZX%23%...
    > > Hi,
    > >
    > > I have a form (server side) because of the filling of variables through
    > > the application. But now I need to post it to an url on submit.
    > > My .HTML form looks like this, but how to translate it to asp.net vb

    code?
    > >
    > > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    > > <form action="https://multipay.net/transaction/mpmain.php"

    method="post">
    > >
    > > ...
    > >
    > > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    > >
    > > I saw messages about doing a client side javascript as action for
    > > onsubmit. This is not clear to be and seems not the right way.
    > >
    > >
    > >
    > > Thanks,
    > >
    > > Gert
    > >
    > >

    >
    >
    Patrick.O.Ige, Nov 4, 2005
    #5
  6. Gert

    Mr Newbie Guest

    Thats only because I have been watching Star Trek Voyager for so long, I
    think I have developed the biological equivelent of a 'Universal
    Translator', and this helps be extrapolate from garbage and bring order to
    chaos . . . . ( Sometimes ! )

    Live Long And Prosper - \\//

    ;-D

    --
    Best Regards

    The Inimitable Mr Newbie º¿º



    "Patrick.O.Ige" <> wrote in message
    news:...
    > Good you understood that Mr Newbie.
    > I was confused.
    > Patrick
    >
    > "Mr Newbie" <> wrote in message
    > news:...
    >> You cant simply post a form to an ASP.NET webserver. You need to create a
    >> webform and GET the webform, flll in the fields and then postback the
    >> form
    >> to the server.
    >>
    >> --
    >> Best Regards
    >>
    >> The Inimitable Mr Newbie º¿º
    >>
    >>
    >> "Gert" <> wrote in message
    >> news:eZX%23%...
    >> > Hi,
    >> >
    >> > I have a form (server side) because of the filling of variables through
    >> > the application. But now I need to post it to an url on submit.
    >> > My .HTML form looks like this, but how to translate it to asp.net vb

    > code?
    >> >
    >> > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    >> > <form action="https://multipay.net/transaction/mpmain.php"

    > method="post">
    >> >
    >> > ...
    >> >
    >> > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    >> >
    >> > I saw messages about doing a client side javascript as action for
    >> > onsubmit. This is not clear to be and seems not the right way.
    >> >
    >> >
    >> >
    >> > Thanks,
    >> >
    >> > Gert
    >> >
    >> >

    >>
    >>

    >
    >
    Mr Newbie, Nov 4, 2005
    #6
  7. Actually, you *can* simply post a form from a server-side app to a web URL.
    I have built a set of classes for doing just this.

    The trick is to create an HTTP POST Request with the form data Url-encoded
    into it as it would be if it were coming from a browser (remember that HTTP
    is stateless - requesting a form from a web server in no way tells the web
    server to expect a form post coming from the client).

    The set of classes I've created have been working quite well from within a
    service we have on our system which checks data on several public weather
    information web sites, to see how long it takes for weather data we provide
    to the NWS takes to get to these web sites.

    In fact, these classes also include the ability to fetch an HTML form from a
    given URL, and parse it into a class (called "HtmlFormData"). The class can
    then be used to programmatically "fill out" the form, by changing the
    various value properties of the different class members (which represent
    HTML form fields), and then post it to the URL of its "action" property. The
    HtmlFormData class can be used to add, remove, or modify the contents of an
    HTML form, or to build one from scratch, if desired. The ToString() method
    of the class returns the HtmlFormData class as HTML (in the form of an HTML
    form).

    It is used in conjunction with several networking classes, most notably the
    HttpClient class that we created, and is part of the same assembly, and a
    set of HTML form-parsing Regular Expressions that are in another class in
    the same assembly.

    I am in the process of creating a commercially-available component class
    library that includes this, as well as over 60 classes, structs, interfaces,
    enumerations, and delegates, which are useful in a variety of situations as
    well. If you'd like to help with the beta testing, email me and I'll send
    you a copy. Just promise to give me your feedback on it.

    Oh yes. One other thing. It's all .Net 2.0.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    A watched clock never boils.

    "Mr Newbie" <> wrote in message
    news:...
    > Thats only because I have been watching Star Trek Voyager for so long, I
    > think I have developed the biological equivelent of a 'Universal
    > Translator', and this helps be extrapolate from garbage and bring order to
    > chaos . . . . ( Sometimes ! )
    >
    > Live Long And Prosper - \\//
    >
    > ;-D
    >
    > --
    > Best Regards
    >
    > The Inimitable Mr Newbie º¿º
    >
    >
    >
    > "Patrick.O.Ige" <> wrote in message
    > news:...
    >> Good you understood that Mr Newbie.
    >> I was confused.
    >> Patrick
    >>
    >> "Mr Newbie" <> wrote in message
    >> news:...
    >>> You cant simply post a form to an ASP.NET webserver. You need to create
    >>> a
    >>> webform and GET the webform, flll in the fields and then postback the
    >>> form
    >>> to the server.
    >>>
    >>> --
    >>> Best Regards
    >>>
    >>> The Inimitable Mr Newbie º¿º
    >>>
    >>>
    >>> "Gert" <> wrote in message
    >>> news:eZX%23%...
    >>> > Hi,
    >>> >
    >>> > I have a form (server side) because of the filling of variables
    >>> > through
    >>> > the application. But now I need to post it to an url on submit.
    >>> > My .HTML form looks like this, but how to translate it to asp.net vb

    >> code?
    >>> >
    >>> > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    >>> > <form action="https://multipay.net/transaction/mpmain.php"

    >> method="post">
    >>> >
    >>> > ...
    >>> >
    >>> > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    >>> >
    >>> > I saw messages about doing a client side javascript as action for
    >>> > onsubmit. This is not clear to be and seems not the right way.
    >>> >
    >>> >
    >>> >
    >>> > Thanks,
    >>> >
    >>> > Gert
    >>> >
    >>> >
    >>>
    >>>

    >>
    >>

    >
    >
    Kevin Spencer, Nov 4, 2005
    #7
  8. Gert

    Mr Newbie Guest

    Good to hear that you might be making some money for your efforts, thats
    allways a bonus!

    I take your point regarding the Url-encoded POST, but the OP was trying to
    do this with a browser I think ?!? What do you do about Viewstate ? or is
    this just left empty ?

    As far as BETA testing your classes, I would be happy to help, but Im snowed
    under at the moment and I dont think I could do your testing justice . But I
    wish you well with it, and if things slow down a little, I may take you up
    on the offer as it sounds really interesting.

    --
    Best Regards

    The Inimitable Mr Newbie º¿º



    "Kevin Spencer" <> wrote in message
    news:...
    > Actually, you *can* simply post a form from a server-side app to a web
    > URL. I have built a set of classes for doing just this.
    >
    > The trick is to create an HTTP POST Request with the form data Url-encoded
    > into it as it would be if it were coming from a browser (remember that
    > HTTP is stateless - requesting a form from a web server in no way tells
    > the web server to expect a form post coming from the client).
    >
    > The set of classes I've created have been working quite well from within a
    > service we have on our system which checks data on several public weather
    > information web sites, to see how long it takes for weather data we
    > provide to the NWS takes to get to these web sites.
    >
    > In fact, these classes also include the ability to fetch an HTML form from
    > a given URL, and parse it into a class (called "HtmlFormData"). The class
    > can then be used to programmatically "fill out" the form, by changing the
    > various value properties of the different class members (which represent
    > HTML form fields), and then post it to the URL of its "action" property.
    > The HtmlFormData class can be used to add, remove, or modify the contents
    > of an HTML form, or to build one from scratch, if desired. The ToString()
    > method of the class returns the HtmlFormData class as HTML (in the form of
    > an HTML form).
    >
    > It is used in conjunction with several networking classes, most notably
    > the HttpClient class that we created, and is part of the same assembly,
    > and a set of HTML form-parsing Regular Expressions that are in another
    > class in the same assembly.
    >
    > I am in the process of creating a commercially-available component class
    > library that includes this, as well as over 60 classes, structs,
    > interfaces, enumerations, and delegates, which are useful in a variety of
    > situations as well. If you'd like to help with the beta testing, email me
    > and I'll send you a copy. Just promise to give me your feedback on it.
    >
    > Oh yes. One other thing. It's all .Net 2.0.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > A watched clock never boils.
    >
    > "Mr Newbie" <> wrote in message
    > news:...
    >> Thats only because I have been watching Star Trek Voyager for so long, I
    >> think I have developed the biological equivelent of a 'Universal
    >> Translator', and this helps be extrapolate from garbage and bring order
    >> to chaos . . . . ( Sometimes ! )
    >>
    >> Live Long And Prosper - \\//
    >>
    >> ;-D
    >>
    >> --
    >> Best Regards
    >>
    >> The Inimitable Mr Newbie º¿º
    >>
    >>
    >>
    >> "Patrick.O.Ige" <> wrote in message
    >> news:...
    >>> Good you understood that Mr Newbie.
    >>> I was confused.
    >>> Patrick
    >>>
    >>> "Mr Newbie" <> wrote in message
    >>> news:...
    >>>> You cant simply post a form to an ASP.NET webserver. You need to create
    >>>> a
    >>>> webform and GET the webform, flll in the fields and then postback the
    >>>> form
    >>>> to the server.
    >>>>
    >>>> --
    >>>> Best Regards
    >>>>
    >>>> The Inimitable Mr Newbie º¿º
    >>>>
    >>>>
    >>>> "Gert" <> wrote in message
    >>>> news:eZX%23%...
    >>>> > Hi,
    >>>> >
    >>>> > I have a form (server side) because of the filling of variables
    >>>> > through
    >>>> > the application. But now I need to post it to an url on submit.
    >>>> > My .HTML form looks like this, but how to translate it to asp.net vb
    >>> code?
    >>>> >
    >>>> > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    >>>> > <form action="https://multipay.net/transaction/mpmain.php"
    >>> method="post">
    >>>> >
    >>>> > ...
    >>>> >
    >>>> > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    >>>> >
    >>>> > I saw messages about doing a client side javascript as action for
    >>>> > onsubmit. This is not clear to be and seems not the right way.
    >>>> >
    >>>> >
    >>>> >
    >>>> > Thanks,
    >>>> >
    >>>> > Gert
    >>>> >
    >>>> >
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Mr Newbie, Nov 4, 2005
    #8
  9. Great idea Kevin.
    Will be intouch
    Patrick

    "Kevin Spencer" <> wrote in message
    news:...
    > Actually, you *can* simply post a form from a server-side app to a web

    URL.
    > I have built a set of classes for doing just this.
    >
    > The trick is to create an HTTP POST Request with the form data Url-encoded
    > into it as it would be if it were coming from a browser (remember that

    HTTP
    > is stateless - requesting a form from a web server in no way tells the web
    > server to expect a form post coming from the client).
    >
    > The set of classes I've created have been working quite well from within a
    > service we have on our system which checks data on several public weather
    > information web sites, to see how long it takes for weather data we

    provide
    > to the NWS takes to get to these web sites.
    >
    > In fact, these classes also include the ability to fetch an HTML form from

    a
    > given URL, and parse it into a class (called "HtmlFormData"). The class

    can
    > then be used to programmatically "fill out" the form, by changing the
    > various value properties of the different class members (which represent
    > HTML form fields), and then post it to the URL of its "action" property.

    The
    > HtmlFormData class can be used to add, remove, or modify the contents of

    an
    > HTML form, or to build one from scratch, if desired. The ToString() method
    > of the class returns the HtmlFormData class as HTML (in the form of an

    HTML
    > form).
    >
    > It is used in conjunction with several networking classes, most notably

    the
    > HttpClient class that we created, and is part of the same assembly, and a
    > set of HTML form-parsing Regular Expressions that are in another class in
    > the same assembly.
    >
    > I am in the process of creating a commercially-available component class
    > library that includes this, as well as over 60 classes, structs,

    interfaces,
    > enumerations, and delegates, which are useful in a variety of situations

    as
    > well. If you'd like to help with the beta testing, email me and I'll send
    > you a copy. Just promise to give me your feedback on it.
    >
    > Oh yes. One other thing. It's all .Net 2.0.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > A watched clock never boils.
    >
    > "Mr Newbie" <> wrote in message
    > news:...
    > > Thats only because I have been watching Star Trek Voyager for so long, I
    > > think I have developed the biological equivelent of a 'Universal
    > > Translator', and this helps be extrapolate from garbage and bring order

    to
    > > chaos . . . . ( Sometimes ! )
    > >
    > > Live Long And Prosper - \\//
    > >
    > > ;-D
    > >
    > > --
    > > Best Regards
    > >
    > > The Inimitable Mr Newbie º¿º
    > >
    > >
    > >
    > > "Patrick.O.Ige" <> wrote in message
    > > news:...
    > >> Good you understood that Mr Newbie.
    > >> I was confused.
    > >> Patrick
    > >>
    > >> "Mr Newbie" <> wrote in message
    > >> news:...
    > >>> You cant simply post a form to an ASP.NET webserver. You need to

    create
    > >>> a
    > >>> webform and GET the webform, flll in the fields and then postback the
    > >>> form
    > >>> to the server.
    > >>>
    > >>> --
    > >>> Best Regards
    > >>>
    > >>> The Inimitable Mr Newbie º¿º
    > >>>
    > >>>
    > >>> "Gert" <> wrote in message
    > >>> news:eZX%23%...
    > >>> > Hi,
    > >>> >
    > >>> > I have a form (server side) because of the filling of variables
    > >>> > through
    > >>> > the application. But now I need to post it to an url on submit.
    > >>> > My .HTML form looks like this, but how to translate it to asp.net vb
    > >> code?
    > >>> >
    > >>> > !--<FORM ACTION="/test/test.php" METHOD=POST>-->
    > >>> > <form action="https://multipay.net/transaction/mpmain.php"
    > >> method="post">
    > >>> >
    > >>> > ...
    > >>> >
    > >>> > <INPUT TYPE=SUBMIT VALUE="SUBMIT ORDER">
    > >>> >
    > >>> > I saw messages about doing a client side javascript as action for
    > >>> > onsubmit. This is not clear to be and seems not the right way.
    > >>> >
    > >>> >
    > >>> >
    > >>> > Thanks,
    > >>> >
    > >>> > Gert
    > >>> >
    > >>> >
    > >>>
    > >>>
    > >>
    > >>

    > >
    > >

    >
    >
    Patrick.O.Ige, Nov 5, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. flo
    Replies:
    2
    Views:
    684
    Bernd Maierhofer \(dato\)
    Nov 24, 2005
  2. jasontoolittle

    Post Form Data to External URL

    jasontoolittle, Sep 28, 2010, in forum: Java
    Replies:
    0
    Views:
    830
    jasontoolittle
    Sep 28, 2010
  3. jasontoolittle

    Post Form Data to External URL

    jasontoolittle, Sep 28, 2010, in forum: .NET
    Replies:
    0
    Views:
    1,296
    jasontoolittle
    Sep 28, 2010
  4. castnblast
    Replies:
    0
    Views:
    78
    castnblast
    Dec 1, 2004
  5. Replies:
    3
    Views:
    664
Loading...

Share This Page