hi
I have 2 page 1-index.aspx 2-Search.aspx
in index.aspx page I have Textbox =txtsearch and Button =searchbutton
in Textbox users enter text and when they click on serachbutton it goes to search.aspx page and according to txtsearch's text it bind datalist=>DDLStore that I define in search.aspx page
below is searchbutton code in index.aspx page
protected void searchbutton_click(object sender, ImageClickEventArgs e)
{
Response.Redirect("search.aspx?data=" + Server.UrlEncode(txtsearch.Text));
}
and this is metod that I bind datalist => DDLStore in search.aspx page
private void GetCustomersPageWiseStore(int pageIndex)
{
using (SqlCommand cmd = new SqlCommand("GCPSearch", _cn))
{
string search = Server.UrlDecode(Request.QueryString["data"]);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@search", search);
cmd.Parameters.AddWithValue("@PageIndex", pageIndex);
cmd.Parameters.AddWithValue("@PageSize", PageSize);
cmd.Parameters.Add("@RecordCount", SqlDbType.Int, 4);
cmd.Parameters["@RecordCount"].Direction = ParameterDirection.Output;
_cn.Open();
IDataReader idr = cmd.ExecuteReader();
DDLstore.DataSource = idr;
DDLstore.DataBind();
idr.Close();
_cn.Close();
int recordCount = Convert.ToInt32(cmd.Parameters["@RecordCount"].Value);
this.PopulatePagerStore(recordCount, pageIndex);
}
}
Now in search.aspx page I define textbox=TxtStore and btnStore like index.aspx page...
and here I want if users enter text in TxtStore and click on btnStore it bind DDLstore according to the text that users entered in txtStore...
in above metod I define
string search = Server.UrlDecode(Request.QueryString["data"]);
this querystring come from index.aspx page but I don't know how I can define something like that for search.aspx page
I mean I want if users enter text in txtsearch in index.aspx or they enter text in txtStore in search.aspx in both position it bind DDLStore...
How I can do it?
Best Regards
Neda