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¶m2=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"]