When a person clicks on a link, I want to do this:
- grab the text from a textbox
- encode the text
- redirect to currentpage.aspx?search=textboxvalue
I have this so far but its not working:
window.location.href = "?search=" + escape( $("#someId").val());
then In button (asp.net)
So after clicking on the button the control will go at serverside , and there
you can access the Querystring you form !
You are changing the wrong location property if you only want to change the search string. I think you want to do this:
you need to prepend the actual base url
What part isn't working?
Try encodeURI() rather than escape().
window.location.href = window.location.href + "?search=" + escape( $("#someId").val());
?