利用JS获取这个A,(strid就是A)
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!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>
    <script type="text/JavaScript">
        function Getid() {
            var url = location.search;
            var strid;
            if (url.indexOf("?") != -1) {

                strid = url.substr(url.indexOf("?") + 4, url.indexOf("&") - url.indexOf("?") - 4);
            }

            window.location.href = "Default.aspx?id=" + strid;
        }
 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="javascript:Getid();">打开新页面,传递ID为A的</a>
    </div>
    </form>
</body>
</html>

posted on 2011-01-07 18:20  Lambert_Zhao  阅读(1436)  评论(2编辑  收藏  举报