Simple DropDownList program
I Need the following to work please help.
<!DOCTYPE html><html>
<head>
<title>Page Title</title>
</head>
<body>
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System. EventArgs) Handles Button1.click
Dim x Aas Double
Dim vat As Double
Dim answere As Double
if DropDownList1.SelectedItem.Text = "Pap & Stew" Then txtPrice.Text = 30
Elself DropDownList1.SelectedItem.Text = "Pap & Chicken" Then txtPrice.Text = 40
Elself DropDownList1.SelectedItem.Text = "Cool drinks" Then txtPrice.Text = 10
Elself DropDownList1.SelectedItem.Text = "Sausage Rolls" Then txtPrice.Text = 12
Elself DropDownList1.SelectedItem.Text = "1 Piece Chicken" Then txtPrice.Text = 10
Elself DropDownList1.SelectedItem.Text = "Regular Chips" Then txtPrice.Text = 12
End if
x = Val(txtPrice.Text) * Val(txtQty.Text)
txtval.Text = x
vat = Val(txtvat.Text) * 0.14
txtCost.Text = vat
answere = Val(txtvat.Text) - (14 / 100)
txtAmtDue.Text = answere
End Sub
<form id="form1" runat="server">
<asp:DropDownList ID="DropDownList1" runat="server"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Enabled="False">Pap & Stew/asp:ListItem
<asp:ListItem>Pap & Chicken/asp:ListItem
<asp:ListItem>Cool drinks/asp:ListItem
<asp:ListItem>Sausage Rolls/asp:ListItem
<asp:ListItem>Piece chicken/asp:ListItem
<asp:ListItem>Regular Chips/asp:ListItem
<br />
<asp:TextBox ID="txtPrice" runat="server" ontextchanged="TextBox1\_TextChanged">/asp:TextBox
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
0 comments:
Post a Comment