0

I am Creating a website in which i added a Paypal Button. I want to be on same Page after Success of Payment. So i want that Payment processing should be done in new tab.My written code is As Follows:-

protected void Button7_Click(object sender, EventArgs e)
{
    string business = "rajpadwa@gmail.com";
    string itemName = "Funds";
    int itemAmount = Int32.Parse(DropDownList1.SelectedItem.Value);
    string currencyCode = "USD";

    StringBuilder ppHref = new StringBuilder();

    ppHref.Append("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick");
    ppHref.Append("&business=" + business);
    ppHref.Append("&item_name=" + itemName);
    ppHref.Append("&amount=" + itemAmount.ToString("#.00"));
    ppHref.Append("&currency_code=" + currencyCode);

    Response.Redirect(ppHref.ToString(), true);
}

Can u please Tell me how to do paypal transaction in new tab while using Response.Redirect() Method...

Ahmet Kakıcı
  • 6,294
  • 4
  • 37
  • 49
yash
  • 812
  • 3
  • 12
  • 37

1 Answers1

0

try with client side code like below

string newScript = "<script language='javascript'>window.open('" + ppHref.ToString() + "', '_blank');</script>";
Page.ClientScript.RegisterClientScriptBlock(this.GetType, "NewWindow", newScript);
Damith
  • 62,401
  • 13
  • 102
  • 153