views:

276

answers:

0

Hello All,

I am having trouble with used of the querystringfield property. I have a server control button which doing the postback when someone clicked it. The Datapager uses the querystringfield property to enable it to use the normal html linking tags.

When I typed some search text and clicked the search button, the datapager's link produced correctly e.g. /Default.aspx?search=blah&page=1. The problem arised after I went to the next page, type some text and did the search again, the datapager link became e.g. /Default.aspx?search=blah&page=2&search=blah&page=3 (2 or 3 depends on the mouse pointing on which link).

The first search and page querystrings are from the url where I have clicked from the previous page link. I have tried to clear the querystring before I change the QueryStringField property, but the querystring property was readonly.

This is the code I placed in my button click events: this.DataPager1.QueryStringField = "search="+this.txt_search.Text + "&page";

        this.ListView1.DataSource = Channel_BLL.FetchPublicChannels(preference_id, "");
        this.ListView1.DataBind();