I have a simple gridview and SqlData source to bind data table to gridview.
My question is :
On “Select” button from the gridview . I would like get a value from a column of current selected row then redirect the user to another page and execute a Sql Select command with the value taken .
I know how to get the value but I don’t know how should I redirect the user and the value to the other page and execute the sql statment with the value taken.
Thank you,
You just need to do
Respose.Redirect(url);and attach value in querystring that will work for you ..on redirected page get the selected value from querystring
Request.QueryString["selectedValue"]but before doing this make sure that Querystring variable is not null.or
if the information is sensitive you dont want user to see it than make use of
Sessionvariable and than doResponse.Redirect(url);on redirected page get the selected value from querystring
string s = Session["SelectedValue"].ToString()but before doing this make sure that session variable is not null.