0
votes

I've been encountering a problem when I click on the button that should redirect to paypal it opens my documents. It was running before but when I transferred the codes to another PC the error occurs. Help!

Here is the code in aspx.cs

protected void btnPayOnline_Click(object sender, EventArgs e) {

        string url = "";

        string business = "[email protected]";
        string description = "Buy";
        string country = "PH";
        string currency = "PHP";
        string amount = Label1.Text;

        url += "https://www.sandbox.paypal.com/cgi-bin/webscr" +
            "?cmd=" + "_xclick" +
            "&business=" + business +
            "&amount=" + amount +
            "&lc=" + country +
            "&item_name=" + description +
            "&currency_code=" + currency +
            "&bn=" + "PP%2dBuyNowBF";

        System.Diagnostics.Process.Start("explorer.exe", url);

}

Here is the aspx codes:

I really dont see what the problem is

1
<div class="col-sm-5"> <asp:Button ID="btnPayOnline" runat="server" Text="Pay using Paypal" CssClass="btn btn-primary" OnClick="btnPayOnline_Click"/> <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btn btn-default" Visible="true" OnClick="btnCancel_Click" /> <asp:Label ID="Label15" runat="server" ForeColor="Red"></asp:Label> </div> aspx codes sorry - Ken Dy

1 Answers

0
votes

Your program starts the folder explorer (thus showing your default local directory), not your web browser.

Replacing explorer.exe by iexplore.exe should solve your issue.