发布于 2016-05-31 12:35:20 | 98 次阅读 | 评论: 0 | 来源: 网友投递
ASP.NET
ASP.NET 是.NET FrameWork的一部分,是一项微软公司的技术,是一种使嵌入网页中的脚本可由因特网服务器执行的服务器端脚本技术,它可以在通过HTTP请求文档时再在Web服务器上动态创建它们。 指 Active Server Pages(动态服务器页面) ,运行于 IIS(Internet Information Server 服务,是Windows开发的Web服务器)之中的程序 。
string strurl = PreUrl + "?word={0}&sort={1}&check={2}";
strurl = string.Format(strurl, HttpUtility.UrlEncode(this.txtSearchTxt.Text.Trim(), System.Text.Encoding.GetEncoding("GB2312")), this.radioSortDesc.SelectedIndex.ToString(), CheckState.ToString());
Page.Response.Redirect(strurl);
//注意编码方式为gb2312
try
{ if (Page.Request.QueryString["word"] != null)
{ _word = Convert.ToString(HttpUtility.UrlDecode(Page.Request.QueryString["word"], System.Text.Encoding.GetEncoding("GB2312"))); }
}
catch { _word = String.Empty; }
///注意编码方式为gb2312,与前面对应
public void PageLocation(string chineseURL)
{
if(chineseURL==null || chineseURL.Trim().Length==0 )
{return;//还可能不是一个合法的URL Tony 2007/11/15
}
Page.ClientScript.RegisterStartupScript(this.GetType(), "AgronetPageLocationTo", "<script type='text/javascript' language='javascript'> window.location.href='"+chineseURL+"';</script>");
}
string strurl = PreUrl + "?word={0}&sort={1}&check={2}";
strurl = string.Format(strurl, this.txtSearchTxt.Text.Trim(), this.radioSortDesc.SelectedIndex.ToString(), CheckState.ToString());
PageLocation(strurl);
<script language= "JavaScript " >
function GoUrl()
{
var Name = "中文参数 ";
location.href = "B.aspx?Name= "+escape(Name);
}
</script >
<body onclick= "GoUrl() " >
string Name = Request.QueryString[ "Name "];
Response.Write(HttpUtility.UrlDecode(Name));