views:

298

answers:

0

I have an ASP.NET page to show search results of a website.I have few static pages and one ASP.NET page(to show results).In my static HTML pages i used form and inside there is a text box ontrol.When user submits the form (form submit to the aspx page), in the aspx page load, i am reading the text box value content and using that i am building the search query.i am using a datagrid to display the results with paging enabled.So if there are 32 results for my search,It will show in 4 pages with each page contains 10 entries. I am storing the search key in a session variable to have it accessed when i click on each page number and use that for building the results.Its working fine. But now i am going to add a search box to the asp.net page which shows the searchresults.Can i use the same form submitting method here ? If i use so, again it will load the page and it will read the value from session [which i used to mainitan the search key for post backs happens during the page number clicks] ,not from the text box, How can i distinguish the page number click event and the form submit on the same page ? Please advice

My code here

    //This is used to maintain the searchkey between the postbacks happens between page number clicks
    strSearchKey = Request["txtSearch"];
    Session["mySearchKey"] = strSearchKey;
    this.Search();