I am constructing a search page with a textbox and a button for now, and probably a dropdown to filter results later on. I have my button’s PostBackUrl set to my search page (~/search.aspx). Is there an easy way to pass the value in the text box to the search page?
Share
If you have the PostBackUrl set on your button, then the search box field on your first page, and any other form fields on that page, are already being posted to your search page. The trick is getting access to them in the code-behind for your search.aspx page.
That is one way. There are some shortcuts too, such as using the PreviousPageType directive at the top of your search.aspx page:
More details on how to use that, as well as the first method, can be found here:
http://msdn.microsoft.com/en-us/library/ms178139.aspx