Default.aspx<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div> <a href="index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93">指标库</a>
<a href="javascript:window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93'">指标库</a>
<input type="button" value="指标库" onclick="window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93';" />
</div>
</form>
</body>
</html>index.aspxusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;public partial class index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Server.UrlDecode(Request.QueryString["name"]));
}
}
<a href="index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93">指标库</a>
<a href="javascript:window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93'">指标库</a>
<input type="button" value="指标库" onclick="window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93';" />
这三个跳转为什么中间用javascript:的是乱码?
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div> <a href="index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93">指标库</a>
<a href="javascript:window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93'">指标库</a>
<input type="button" value="指标库" onclick="window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93';" />
</div>
</form>
</body>
</html>index.aspxusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;public partial class index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Server.UrlDecode(Request.QueryString["name"]));
}
}
<a href="index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93">指标库</a>
<a href="javascript:window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93'">指标库</a>
<input type="button" value="指标库" onclick="window.location='index.aspx?name=%E6%8C%87%E6%A0%87%E5%BA%93';" />
这三个跳转为什么中间用javascript:的是乱码?
Response.Write(Server.UrlDecode("%e7%86%8a%e7%8c%ab"));//输出:熊猫