Simulate Form Post on Server Side

Discussion in 'ASP .Net' started by BarryX, Sep 26, 2007.

  1. BarryX

    BarryX Guest

    Hi,

    How do I simulate this from the server side:

    <form name="SearchForm" method="POST" id="SearchForm"
    action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

    I have generally been posting data using:

    Set xml = Server.CreateObject("Microsoft.XMLHTTP")
    xml.Open "POST","http://SOMEURL/Search.asp?" & strParmList, False
    xml.Send

    The above is fine for passing URL parameters, but I need to simulate it
    coming from a form which has a name. How do I pass the form name
    which is used at the posted URL?

    Help!
    BarryX, Sep 26, 2007
    #1
    1. Advertising

  2. BarryX

    Patrice Guest

    See System.Net.Webclient and in particular the UploadData method that uses
    key/value pairs (http://support.microsoft.com/kb/290591 for "classic ASP"
    but in this case note that this is not the suitable forum, this one is for
    ASP.NET)..

    --
    Patrice

    "BarryX" <> a écrit dans le message de
    news: ...
    > Hi,
    >
    > How do I simulate this from the server side:
    >
    > <form name="SearchForm" method="POST" id="SearchForm"
    > action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">
    >
    > I have generally been posting data using:
    >
    > Set xml = Server.CreateObject("Microsoft.XMLHTTP")
    > xml.Open "POST","http://SOMEURL/Search.asp?" & strParmList, False
    > xml.Send
    >
    > The above is fine for passing URL parameters, but I need to simulate it
    > coming from a form which has a name. How do I pass the form name
    > which is used at the posted URL?
    >
    > Help!
    >
    >
    >
    Patrice, Sep 26, 2007
    #2
    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. Al Cadalzo

    How to simulate a form post?

    Al Cadalzo, Feb 17, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    7,522
    Al Cadalzo
    Feb 17, 2004
  2. delph
    Replies:
    3
    Views:
    1,306
    Andrea Desole
    May 13, 2005
  3. dast

    Simulate post at webpage

    dast, Sep 15, 2005, in forum: C++
    Replies:
    2
    Views:
    306
    =?ISO-8859-1?Q?Stefan_N=E4we?=
    Sep 15, 2005
  4. nospam
    Replies:
    1
    Views:
    427
    sloan
    Oct 13, 2007
  5. BarryX

    Simulate form post from Server Side

    BarryX, Sep 26, 2007, in forum: ASP General
    Replies:
    9
    Views:
    380
    Anthony Jones
    Oct 2, 2007
Loading...

Share This Page