当点击“登录”按钮后,页面上方显示“某某某用户自动登录的天数为: 天”。 “天”实际为0、1、3、7、30、365天其中之一。
protected void Button1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "", "alert('TextBox1.Text+用户自动登录的天数为:+ DropDownList1.Text+天。');", true);
那你需要判断
if (DropDownList1.Text == "一天")
x = 1;
if (DropDownList1.Text == "三天")
x = 3;
...
ClientScript.RegisterStartupScript(this.GetType(), "", "alert('用户自动登录的天数为: "+ x + "天。');", true);
非常感谢,通过你给的方法我实现了我要的功能