How can I write an event that does a specified calculation when an option is selected that the submit button is selected? Say I have the following code:
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Go swimming</asp:ListItem>
<asp:ListItem>Play sudoku</asp:ListItem>
<asp:ListItem>Practice piano</asp:ListItem>
<asp:ListItem>Play solitaire</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Button ID="Train" runat="server" Text="Train" onclick="Train_Click" /><br /><br />
<asp:Label
ID="testLabel" runat="server" />
</div>
</form>
I have four options: go swimming, play sudoku, practice piano, and play solitaire. I have a button, and a label to display the value of the calculation performed for testing purposes. Say I want to set an event that says:
If go swimming is selected, multiply 500 by .001, and display this value in the label, when the button is pressed.
If play sudoku is selected, multiply 500 by .002, and display this value in the label, when the button is pressed.
etc...
How would I go about starting this event out?