asp.net advanced search form, results in a grid and back button
I'm working on a asp.net forms web application where I've got advanced search form with grid listing results below. Grid is sortable and pageable. Grid is listing products.
I've got two requirements :
1) make the url remember the advanced search form state so search results page can be bookmarked etc.
2) on the product details page there is a back button that should take the user to the advanced search page with the same settings in the form and same grid state.
I have implemented a workaround to above two problems but I don't think my solution is very clean and I'd like to hear better ideas. My workaround is as follows :
1) I iterate through form fields and I put values into the querystring after the hash. So when the page is loaded it gets the values from url if available.
2) when user clicks a link to product details page from the grid I use javascript to create a cookie wit开发者_StackOverflow社区h url to advanced search page so when rendering the product details page I know the url for the back button.
I'd like to achieve above functionality in cleaner way.
Thanks, M
You could try setting the search page form action to GET. This will put everthing in the query string for you, enabling the bookmarking and the back button.
精彩评论