C#后台输出HTML控件,后台操作和获得值

前台:


        
        

         

后台:

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.Literal1.Text = "";
            }
        }
        protected void Button1_OnClick(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "$('#te').val('你好吗?');", true);
        }
        protected void Button2_OnClick(object sender, EventArgs e)
        {
            string[] values = Request.Form.GetValues("te");
            this.Label1.Text = values[0];
        }



你可能感兴趣的:(C#知识点)