62,073
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script src="jquery.js"></script>
<script src="jquery.cook.js"></script>
<script>
function a(){
$.cookie("a","4aaaaaaaaa");
window.location.href="Default.aspx";
}
</script>
</head>
<body>
<input type=button value="按钮" onclick="a()" />
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.Cookies["a"] != null)
{
string b=Request.Cookies["a"].Value.ToString();
Response.Write("<script>alert("+b+");</script>");
}
}
}
}