我有一个下拉列表,其中存储了 3 个元素。
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True"
Height="22px" Width="134px">
<asp:ListItem>Please Choose</asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
当用户在下拉菜单中选择 Yes 时,YES 将存储在 session 中。司机服务将向用户收取 30 美元。
Session["IsChauffeurUsed"] = DropDownList4.SelectedItem.Selected;
事情是如果用户选择是,用户必须支付的当前金额是
int totalValue = 0;
int total = 0;
totalValue = int.Parse(Session["price"].ToString()) * int.Parse(Session["day"].ToString());
Label8.Text = totalValue.ToString();
* Label8.text 将加 30(如果用户选择是)
我卡在粗线。如果用户选择是,我不知道如何在 totalValue 中添加 30 我希望你们可以帮助我。干杯。