Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How can I add the query string to the XSLTsearch results URL?
When I click on the submit button, I would like the query string to display in the URL:e.g /search-results.aspx?search=red
<xsl:if test="$searchBoxLocation='TOP' or $searchBoxLocation='BOTH'">
<input name="search" type="text" class="input">
<input type="submit" class="submit">
Can anyone help me out?
Is the method set to 'get' on the form tag? (i.e. <form method="get"> )
It's currently set in my template as <form id="form1" runat="server"> which on the front end the method sets to "post"
And what happens if you specifically add the method="get" attribute to that tag? (I hardly ever use the server-side webform so wouldnt know how it affects your page).
XSLTsearch works with either method so you should be able to get it working, somehow.
Chriztian is quite right, you don't need a server-side form for XSLTsearch to work so you can remove the runat="server" portion of the <form> tag and save some viewstate overhead. He's also correct that you can use either action="post" (which uses form fields so you don't see anything on the querystring) or action="get" (whcih uses and displays urls with querystring values).
One last tid-bit... even if you're using action="post" (as I typically do) you can always manually supply a search term on the querystring and it will work. This is handy for emails, for instance, when you want to send a link to a specific search result. mydomain.com/search.aspx?search=JV would show results for 'JV'. Though if you're using action="post" you won't see the querystring used after the initial search. Still, handy though and I've found it quite helpful.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted