url.action参数问题

var keyword = encodeURIComponent($("#search").val());

 

var url = "@Url.Action("SearchResult")" + "?name=" + keyword;

window.location = url;

 

You have three options:

escape() will not encode: @*/+

encodeURI() will not encode: ~!@#$&*()=:/,;?+'

encodeURIComponent() will not encode: ~!*()'

 

 

 

你可能感兴趣的:(url.action参数问题)