SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to transfer and post data to a url at the same time??

    Hi all

    I am trying to insert an order into my own database, post some data to a third party payment system and redirect the user to payment page all in the same method.

    I can write to the database ok, i can post the data to the payment URL but i cant redirect the user.

    I have tried Server.TransferRequest but im getting a PlatformNotSupported exception. I have also tried using a basic html form (which works) but doesnt allow me to execute of code in the .cs file (to insert into the database).

    I have this on the button click event:

    Code Csharp:
     
    protected void Btn_Purchase(object sender, EventArgs e)
        {
            Order o = (Order)Session["order"];
            Customer c = (Customer)Session["customer"];
            onlinepayments.OrderDAC.InsertOrder(o, c);
     
    NameValueCollection nv = new NameValueCollection(3);
            nv.Add("epdqdata", encryptedData);
            nv.Add("returnurl", "http://www.mysite.com");
            nv.Add("merchantdisplayname", "MySite");
     
            Server.TransferRequest("https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdqEncTool.e", true, "POST", nv);

    any suggestions are much appreciated...

    thanks


  2. #2
    SitePoint Member
    Join Date
    Feb 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Server.TransferRequest will only work with IIS 7. Are you attempting to transfer to a page outside your application or server? Then you are using the wrong functionality as this is simply meant to transfer a request and context to another part of an IIS 7 application.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh balls.. my host is running IIS 6

    and yes the URL im transferring to is another site. any suggestions on how i ca do this?


Bookmarks

Posting Permissions

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