当前位置:编程学习 > C#/ASP.NET >>

一个JS问题

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.aspx

using 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.UrlEncode("熊猫"));//输出:%e7%86%8a%e7%8c%ab
            Response.Write(Server.UrlDecode("%e7%86%8a%e7%8c%ab"));//输出:熊猫
--------------------编程问答-------------------- 我不是那个意思,但是还是谢谢你,我知道答案了 --------------------编程问答-------------------- 楼主结贴率恐怖。。。。
发帖110.
未结贴105
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,