Gets or sets the unit price for the item being sold.

Namespace:  C1.Web.C1PayPal
Assembly:  C1.Web.C1PayPal.2 (in C1.Web.C1PayPal.2.dll)

Syntax

C#
[CategoryAttribute("Item")]
[DefaultValueAttribute()]
[DescriptionAttribute("Amount that will be charged for the item (e.g. $16.95)")]
[BindableAttribute(true)]
public double ItemPrice { get; set; }
Visual Basic (Declaration)
<CategoryAttribute("Item")> _
<DefaultValueAttribute()> _
<DescriptionAttribute("Amount that will be charged for the item (e.g. $16.95)")> _
<BindableAttribute(True)> _
Public Property ItemPrice As Double

Remarks

The amount is specified in US dollars by default, but you can specify other currencies using the Currency property.

Because this property is of type double, you need to edit data binding expressions that set its value. By default, when you bind this property to a database field, Visual Studio generates a line that looks like this:

Copy CodeC#
// doesn't work
c1Button.ItemPrice = <% DataBinder.Eval(Container, “DataItem.UnitPrice”) %>

This doesn't work because the value returned is a string and the assignment will fail at runtime. To fix it, you need to replace the above code with the following:

Copy CodeC#
// works fine
c1Button.ItemPrice = <% double.Parse(DataBinder.Eval(Container, “DataItem.UnitPrice”).ToString()) %>

The default value for this property is 0.

See Also