vuyiswamb 17 Posting Whiz

Good Dal All

i have this aspx page

<%@ Page Language="C#" Async="true" Trace="true" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body> 
    <form runat="server" method="post"  action="https://www.vcs.co.za/vvonline/ccform.asp" >
    <asp:HiddenField ID="p1" Value="4635" runat="server" />
    <asp:HiddenField ID="p2" Value="2" runat="server" />
    <asp:HiddenField ID="p3" Value="Some Goods" runat="server" />
    <asp:HiddenField ID="p4" Value="5.00" runat="server" />
    <asp:Button ID="btnSubmit" runat="server" Text="Pay by Credit Card" 
       />
    </form>
</body>
</html>

what happens here is that on the Client side when someone clicks the Button it will do the payment and redirect to the page, i want to do this one the server side. i tried this

protected void btnSubmit_Click1(object sender, EventArgs e)
    {

        string P1 =  p1.Value;
            
        string P2 = p2.Value;

        string P3 = p3.Value;

        String URl = "https://www.vcs.co.za/vvonline/ccform.asp?p1=" + P1 + "&p2=" + P2 + "&p3=" + P3;
        WebClient svc = new WebClient();
        svc.UploadStringAsync(new Uri(""), "Post", "AT");
        svc.UploadStringCompleted += new UploadStringCompletedEventHandler(svc_UploadStringCompleted);
        
       
    }

and

void svc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
    {
        String estr = e.Result;
    }

You can test using that URL

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.