asp.net - Searching on 404 page returns back to 404 page back -


we have 404 page. when in 404 page, have search box. if try search search box, again returns 404 page. how handle this?

ps: search button inside user control , user control inside masterpage.

when go site below; http://www.x.com/dk

it goes 404.

then if make search th,s 404 page directs link below; http://www.x.com/dk?404%3bhttp%3a%2f%2fwww.x.com%3a80%2fdk

my web config sets

   <customerrors mode="off" defaultredirect="error.aspx">       <error statuscode="404" redirect="pagenotfound.aspx" />    </customerrors>     <httperrors>     <remove statuscode="404" substatuscode="-1" />     <error statuscode="404" path="/pagenotfound.aspx" prefixlanguagefilepath=""            responsemode="executeurl" />     </httperrors> 

i solved problem via javascript

<script type="text/javascript">      $("#btnsearch").attr("onclick", "search('/search.aspx?text=' + encodeuri($('#txtsearchinput').val())); return false;");      function search(text) {         location.href = text;     }  </script> 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -