Implementing PayPal payment on my website
I'm using visual studio to make my website. I'm having difficulties on how to set the price of the item to a specific given number.
Here is the code for the aspx.cs file:
protected void btnPurchaseExamQuestions_Click(object sender, EventArgs e)
{
decimal postagePackingCost = 3.95m;
decimal examPaperPrice = 10.00m;
int quantityOfExamPapers = int.Parse(ddlExamQuantity.SelectedValue);
decimal subtotal = (quantityOfExamPapers * examPaperPrice);
decimal total = subtotal + postagePackingCost;
As you can see, decimal examPaperPrice = 10.00m;
is set to 10.00m. Which means when ever I click the submit button it will always be £10 total price.
I want it to get its value from an SQL data source but I have no idea what to write. Of course decimal isnt the correct code as that would only look for an integer.
My database has got a "Cost" column and this is how I call it using a repeater that is linked to an SQL data source:
<span class="prDes">£<%# Eval("Cost") %></span></td>
This will show the cost of the item based on the ID I chose. So IF I pick item 1 it will result £30.
But again, if I want to set the paypal cost to the cost of an specific item in my database how can I do that? Thanks.
链接地址: http://www.djcxy.com/p/6096.html上一篇: 怎么做
下一篇: 在我的网站上实施PayPal付款