首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

Server.UrlEncode 编码传值?请帮忙解决,多谢

2012-02-21 
Server.UrlEncode 编码传值?请帮忙解决,谢谢%ifRequest( action ) sss thentextRequest.querystrin

Server.UrlEncode 编码传值?请帮忙解决,谢谢
<%
if   Request( "action ")= "sss "   then
text=Request.querystring( "text ")
Response.Write   text
Response.End
end   if
%>
<form   id= "form1 "   name= "form1 "   method= "post ">
    <input   type= "text "   name= "text "   />
<input   name= "button "   type= "button "   value= "提交 "  
onClick= "location.href= '122222.asp?action=sss&text= <%=Server.UrlEncode   ()%> '+document.form1.text.value+ ' ' ">   </form>


[解决办法]
<form id= "form1 " name= "form1 " method= "post " action= " ">
改:
<input name= "button " type= "button " value= "提交 "
onClick= "location.href= '122222.asp?action=sss&text= <%=Server.UrlEncode ()%> '+document.form1.text.value+ ' ' ">  为:
<input name= "button " type= "button " value= "提交 "
onClick= "document.form1.action= '122222.asp?action=sss&text= '+escape(document.form1.text.value)+ ' ' ">  

你要直接改就用escape()

热点排行