I have a product listing page. All the products are display based on 3 criteria :
- When user click on the left menu
- When user input in search text box and search
- When user choose in the brand combo box
This is the exam url due to the user click the below list :
- http://mysite.com/Products?dep=1&cat=2&tab=2 : display the product that have depId = 1 , and categoryID = 2.
- http://mysite.com/Products?brand=ABC_2&tab=2 : display the product that have the brand name = "ABC" and brand id=2
- http://mysite.com/Products?tab=2&search=ABCD : display the product that the product name = "ABCD"
Problem : When the user click on each link below, the page will refresh, so I cannot mix the parameter string together. I want to combine these 3 criteria together, mean when the user click on (1) then continue to (2) and (3), the url will :
http://mysite.com/Products?dep=1&cat=2&brand=ABC_2&search=ABCD&tab=2
So the page will display the product that have depID = 1, categoryID = 2, brand id = 2, brand name = ABC and product name = "ABCD".
This is what I have tried to get the (3) in my site.master :
function SearchClick() {
window.location = "/Products?tab=2" + ($("#txtsearch").val() != "" || $("#txtsearch").val()
== "undefined" ? "&search=" + $("#txtsearch").val() : "");
}
Thanks in advanced.