string IsChauffeurUsed = "Yes";
totalValue += IsChauffeurUsed.Equals("Yes", StringComparison.CurrentCultureIgnoreCase) ? 80 : 0;
Label8.Text = totalValue.ToString();
上面这行代码让系统在计算后加80加
int totalValue = 0;
totalValue = int.Parse(Session["price"].ToString()) * int.Parse(Session["day"].ToString());
如果仅用户在下拉列表中选择“是”,如何使其仅添加 80。我将选择存储在会话中
Session["IsChauffeurUsed"] = DropDownList4.SelectedItem.Text;