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. Advertisements

  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. Advertisements

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. Rick Spiewak
    Replies:
    1
    Views:
    524
    Rick Spiewak
    Jul 22, 2003
  2. Al Cadalzo

    How to simulate a form post?

    Al Cadalzo, Feb 17, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    7,823
    Al Cadalzo
    Feb 17, 2004
  3. Mythran
    Replies:
    2
    Views:
    748
    Mythran
    Jan 22, 2005
  4. Sudheer Aalla

    Post server side form to different application

    Sudheer Aalla, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,825
    Rob Schieber
    Oct 6, 2005
  5. Gert
    Replies:
    8
    Views:
    10,300
    Patrick.O.Ige
    Nov 5, 2005
  6. nospam
    Replies:
    1
    Views:
    522
    sloan
    Oct 13, 2007
  7. ERobishaw
    Replies:
    1
    Views:
    1,012
    Anthony Jones
    Mar 22, 2008
  8. BarryX

    Simulate form post from Server Side

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