jinyuttt

导航

html选择控件获取选择值

select控件name="ds"

后台

 protected void Button1_Click(object sender, EventArgs e)
        {
            //this.TextBox1.Text = Request.Form["ds"].ToString();
            //this.TextBox2.Text = Request["ds"].ToString();
            string cal = "";
            foreach (string ele in Request.Form.AllKeys)
            {
                if (ele.Contains("sds"))
                {
                    cal = Request[ele];
                    break;
                }

            }
            this.TextBox2.Text = cal;
        }

点击button1就可获取选择的值。

posted on 2011-02-21 16:19  代码苦行僧  阅读(400)  评论(0编辑  收藏  举报