我有一個下拉列表,裏面存儲了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將被存儲在會話中。司機服務將收取用戶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(如果用戶選擇yes)
我被困在粗線上。我不知道如何在totalValue中添加30,如果用戶選擇YES,我希望你們能幫助我。乾杯。
你能改說你的問題嗎?目前還不清楚。 – 2012-08-02 07:07:00
那麼你的問題是什麼? – Jeeva 2012-08-02 07:07:50
如果'Session [「IsChauffeurUsed」]'等於「Y」,則將總值加上30,現在你在哪裏卡住? – V4Vendetta 2012-08-02 07:09:25