2009年6月4日 星期四

Asp.net Server.UrlEncode(可預防網址被截段)

說明

將字串作 URL 編碼,並傳回編碼的字串

作用

如網址字串中可能有空格或是特殊字元時可用

範例

Dim MyURL As String
MyURL = "http://www.contoso.com/articles.aspx?title=" & trim(Server.UrlEncode("ASP.NET Examples"))
Response.Write( " ASP.NET Examples ")