URl中的%不起作用 [英] % in URl not working
问题描述
大家好,
我的项目中遇到了不同的情况。我有一个搜索框来搜索商店中的产品。他们也可以搜索specail字符...我只是将搜索文本作为查询字符串发送到我的搜索页面
所以我编码特殊字符以避免< b> 400错误请求,其中包含非法路径字符。所以我对编码很好....但我的主要问题是,当我尝试搜索时如
搜索关键字:产品33%
编码: Product33 [%25]
结果:搜索执行良好,首次搜索时列出的产品
网址路径:....搜索/产品33 [%25]
没有刷新页面我给了另一个搜索词
搜索关键字:< b> PenDrives
编码: PenDrives
结果: HTTP错误400.请求网址无效。
网址路径:....搜索/ [%]
首次搜索工作正常%,当我尝试搜索另一个搜索键时,页面错误输出.... Remaing所有情况都正常工作,除非我们尝试使用%
提前感谢...
由于URL类似......
Url Path: ....搜索/ [%]
这意味着,您没有获得在搜索<$ c $中输入的值C>文本框。调试并找出确切的问题,因为你没有在后面的代码中获得搜索框值。
Hello Every one,
I was struck with a different situation in my project. I have a search box to search products in the store. they can search with specail characters also ... I am just sending the search text as a query string to my Search page
So I am encoding the special character to avoid 400 Bad request which takes as a illegal path characters . So i am ok with encoding.... but my main problem is that when I tried to search like
Search Keyword : Product33%
Encoded : Product33[%25]
Results : Search executed well and prodcuts listed out at first search attempt
Url Path : "....Search/Product33[%25]"
without refreshing the page i gave another search word
Search Keyword : PenDrives
Encoded : PenDrives
Results : HTTP Error 400. The request URL is invalid.
Url Path : "....Search/[%]"
first search is working fine with "%" and when i tried to search on another search key the page is error ed out .... Remaing all cases are working fine except if we tried to search with %
Thanks in advance...
As the URL is like...
Url Path : "....Search/[%]"
That means, you are not getting the value entered in the SearchTextBox
. Debug and find out what is the exact issue, due to which you are not getting the Search Box value in code behind.
这篇关于URl中的%不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!