zoukankan      html  css  js  c++  java
  • js获取服务器值以及服务器获取客户端值

    1.Label  

    var text= document.getElementById(("<%=this.Label1.ClientID%>").innerText;

    2.TextBox

    var text= document.getElementById("<%=this.TextBox1.ClientID%>").value

    3.DropDownList

    var ddlvalue = document.getElementById('ctl00_Contentplaceholder3_ddlFolws').value

    4.RadioButtonList

            var value = "";

            var Result = document.getElementsByName('ctl00$Contentplaceholder3$rblResult');
            for (var i = 0; i < Result.length; i++) {
                if (Result.item(i).checked) {
                    value = Result.item(i).value;
                }
            }

    服务器获取客户端值

    <input type="text" name="test" />

    方法1:Response.Write(Request.Form[test].toString())

    方法2:System.Collections.Specialized.NameValueCollection nc = new System.Collections.Specialized.NameValueCollection(Request.Form);
               Response.Write(nc.GetValues("test")[0].ToString());

      

  • 相关阅读:
    Python格式符号
    Python基础知识
    HDFS 数据流程
    HDFS IO流操作
    HDFS API操作
    Hadoop 客户端环境准备
    Hadop 环境搭建 windows10+hadoop2.7.7
    Hadoop HDFS shell
    Hadoop HDFS 基础
    centos 更改清华源
  • 原文地址:https://www.cnblogs.com/YuanShuai/p/3000609.html
Copyright © 2011-2022 走看看