zoukankan      html  css  js  c++  java
  • asp.net传值

    input标签传值   <input type="text" id="txtName" name="txtName" runat="server"/>

    Request.Form[]接收  string txtName = Request.Form["txtName"].ToString();

    表单传值     <form name="form1" method="post" action="02.jsp">   你的姓名:<input type="text" name="name">   你的爱好:<input type="text" name="hobby">    </form>

    request.getParameter()接收   String name= request.getParameter("name"); String hobby=request.getParameter("hobby");

    url传值   Default.aspx?param1=1111&param2=2222

    Request.QueryString接收值  var userId=Request.QueryString["UserId"]

    Session传值  Session["name"] = txtName.Value

    接收   string name = Session["name"].ToString();

    Cookie传值    HttpCookie cookie = new HttpCookie("MyCookie", aa); Response.Cookies.Add(cookie)

    接收  HttpCookie myCookie = Request.Cookies["MyCookie"]; txt1.Value = myCookie.Value;

    Application传值
    Application["count"] = 12;
    接收
    int count= (int)Application["count"]

  • 相关阅读:
    SpringMVC—对Ajax的处理(含 JSON 类型)(2)
    md5加密(1)
    js生成邀请码(2)
    SpringMVC---依赖注入与面向切面
    初识json
    java集合类(2)
    springmvc与struts2的区别
    模拟14
    NOIP模拟13
    NOIP模拟12
  • 原文地址:https://www.cnblogs.com/zhengwei-cq/p/6605019.html
Copyright © 2011-2022 走看看