Hi EveryBody,
I have a problem, that i have been searching for it without any clue.
I hope i find it here.
This is what i want to make:
First:I have an asp page that contains a gridview, that retreive all the data from a sql table(via SQLDataSource).
Second:I have made a check box feild.(The value of the checkbox is the ID of the table).
Third:I have a button, when i click this button, it takes the value of the ID(if the checkbox is checked) and put this value in a strng variable.
The value of the variable will be something like that:
"1 2 4 6 8".
here is the code to do that:
string Array="";
for(int i=0;i<GridView1.Rows.Count;i++)
{
GridView1.SelectedIndex=i;
CheckBox cb_seleceted = (CheckBox)GridView1.SelectedRow.FindControl("Check Box1");
if (cb_seleceted.Checked == true)
{
Array += GridView1.SelectedDataKey.Value.ToString() + " ";
}
}
Array += "-1500";
Session["ID_Array"] = Array;
Response.Redirect("Default2.aspx");
The question is:
in another page, i need to select the sql table again,filtered by these IDs(that are in the string variable).
How can this be done?
Ramy Amr