0

I have a serarch box on my website. The searchbox is a html inputbox, when i write somthing in the inputbox and submit i wish to get the input and insert it to my querystring. Normally when i do somthing like this i use the Eval option since i normally get the input from the serverside. Like this <a style="color: black" href="ProductInfo.aspx?id=<%# Eval("itemId") %>"> when i do like this the query string is equal to the id of the item i click.

but is it possible to do it the other way where i dont get info from serverside?



i have this inputbox.

<input runat="server" id="txtSearchInput" name="search" placeholder="GTIN, Brand or Article nr" />

it is for searcing. When i press enter i wish the input from this box stored in the query string and then get redirected to anotherpage so that i can use the input from the first page. If that makes sense?

Code_Viking
  • 618
  • 1
  • 8
  • 26

1 Answers1

2

Put it in a form. Make sure the name attribute matches the name of the field you want in the query string.

<form action="ProductInfo.aspx">
    <label>GTIN, Brand or Article nr <input name="id"></label>
    <input type="submit">
</form>
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335