Hello Daniweb, I am building a simple form to calculate and display a discounted price using VB. Here is what I am trying to do... lblDiscount = txtPercent / 100 * txtPrice
lblPrice = txtPrice - lblDiscount
Here is the code that I have so far...I am just a little stuck and a little hint in the right direction would be awsome.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (IsValid)
{
decimal percent = Convert.ToDecimal(txtPercent.Text);
decimal price = Convert.ToDecimal(txtPrice.Text);
lblDiscount.Text = lblDiscount.ToString("c");
decimal tltprice = Convert.ToDecimal(lblPrice.Text);
decimal lbldiscount = percent / 100 * price;
}
}
}