当前位置:编程学习 > C#/ASP.NET >>

下面代码是什么意思啊

string biaoti = this.Request.Form["txt_biaoti"];
这行代码是什么意思啊 --------------------编程问答-------------------- 定义了1个字符串类型的参数biaoti并将其值设为页面上控件ID为txt_biaoti的文本框控件内用户输入并提交的文本内容 --------------------编程问答-------------------- 网页上有个文本框叫txt_biaoti
提交给服务器后,服务器获取它的值。 --------------------编程问答-------------------- 获取网页上ID为txt_biaoti的值并提交给服务器 --------------------编程问答-------------------- 网页上有个文本框叫txt_biaoti
提交给服务器后,服务器获取它的值。 --------------------编程问答-------------------- 取表单中name="txt_biaoti"的value值。 --------------------编程问答-------------------- 获取上一页中的   name值为txt_biaoti的控件的值 --------------------编程问答--------------------  protected void Page_Load(object sender, EventArgs e)
    {
        string str = Request.Form["TextBox1"];
        Response.Write(str);
    }
我的代码是这样的,不知为什么运行后页面上什么都没有 --------------------编程问答--------------------
引用 7 楼 yanzhongkuics 的回复:
 protected void Page_Load(object sender, EventArgs e)
    {
        string str = Request.Form["TextBox1"];
        Response.Write(str);
    }
我的代码是这样的,不知为什么运行后页面上什么都没有

什么意思?  是页面上没东西吗? --------------------编程问答-------------------- 嗯
没有 --------------------编程问答-------------------- --------------------编程问答-------------------- 有谁知道啊 --------------------编程问答-------------------- 页面上面 写个:
<input id="TextBox1" name="TextBox1" value="123">


在后台.cs文件里面写:


protected void Page_Load(object sender, EventArgs e)
  {
  string str = Request.Form["TextBox1"];//Request.Form[""] 是获取页面 input value值
  Response.Write(str);
  }


页面运行得出的结果是123

--------------------编程问答-------------------- --------------------编程问答-------------------- 取表单中name="txt_biaoti"的value值。
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,