get selected Gridview value of the first or destination page [Resolved]

Posted by Bugwee under ASP.NET on 5/30/2011 | Points: 10 | Views : 2247 | Status : [Member] | Replies : 7
Hi,

i have a gridview which is placed on the first aspx page. When the row of the gridview is clicked it will redirect to the second aspx page. How could i get the selected row value(s) of the first aspx page and use the row value(s) in the second aspx page?

Thanks,
Bugwee




Responses

Posted by: A4u6178 on: 5/31/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi bugwee,

you can pass the row as a querystring to your next page....

Thanks & Regards;
aaa

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bugwee on: 5/31/2011 [Member] Starter | Points: 25

Up
0
Down

Resolved
hi A4u6178,

It works well... Thanks for your idea...

<asp:HyperLinkField DataNavigateUrlFields="branchCode"

DataNavigateUrlFormatString="branch.aspx?bcID={0}"
Text="branchCode" />


Regards,
Bugwee

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bugwee on: 5/30/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

By the way, currently i able to get the selected row values and use on the second page trough session variables. But is there any way aside from using session variables and view states?

Regards,
Bugwee

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: A4u6178 on: 5/31/2011 [Member] Starter | Points: 25

Up
0
Down
Try this,

GridViewRow row = (GridViewRow)grid1.Rows[e.RowIndex];





Thanks & Regards;
aaa

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bugwee on: 5/31/2011 [Member] Starter | Points: 25

Up
0
Down
Hi A4u6178,

Thanks for your response but the snippet you have given is just to get the data or value in a row. What i want is how to get or pass the selected row values of a gridview from first page to second page?

Regards,
Bugwee


Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: A4u6178 on: 5/31/2011 [Member] Starter | Points: 25

Up
0
Down
Hi bugwee,

You are welcome!!!

Thanks & Regards;
aaa

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response