protected void Button2_Click(object sender, EventArgs e)
{
//加入两个 参数到 URL
string strUrl = "~/Default.aspx?";
strUrl += "CommodityName=" + Server.HtmlEncode("tbxCommodityName") + "&";
strUrl += "SortID=" + Server.HtmlEncode("2") + "&";
//去掉最后一个“&”分割符
strUrl.Substring(0, strUrl.Length - 1);
//将客户端重定向到新的 URL 并指定该新 URL。
Response.Redirect(strUrl);
}
protected void Button3_Click(object sender, EventArgs e)
{
//获得这两个 参数的 值
string sCommodityName = Request.Params["CommodityName"] == null ? "" : Server.HtmlDecode(Request.Params["CommodityName"].ToString().Trim());
string sSortID = Request.Params["SortID"] == null ? "" : Server.HtmlDecode(Request.Params["SortID"].ToString().Trim());
//消息框输出
string sMsg = "Param1 = " +sCommodityName + " Param2 = " + sSortID ;
Response.Write("
window.alert('" + sMsg + "')
// -->");
//获得所以参数值, 包括系统所有的参数值
string s = "";
foreach (string Key in Request.Params.AllKeys )
{
s += Key + " |";
}
Response.Write("
window.alert('" + s + "')
// -->");
}