Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
How can by click on linkbutton in gridview1(in page1)go to page2 and only show selected gridview1's row (page1)on gridview1(page2) (all of gridview's rows have linkbutton)?
Posted
Updated 29-Apr-11 9:04am
v2

I think there are various ways to do this, like

1) If you have stored some unique value in grid row like ID or some name , then you can pass it to another page
(Page 2) and get the data from data source belongs to that ID/Name and show it in the grid.

2) Another way could be, pass all the data from grid1 to another page and show this in the grid on page 2.
 
Share this answer
 
Comments
nicolas_545 29-Apr-11 15:57pm    
How can pass selected data from gridview on page1 to gidview on other pages?
Brij 29-Apr-11 16:00pm    
one way ..querystring or session etc..
You can use one of the various state managememnt techinques.
Have a look here:
MSDN: ASP.NET State Management Overview[^]
State management in ASP.NET - 1[^]
ASP.Net State Management Techniques - 2[^]

As said, querystring or Sessions can be easy options.
 
Share this answer
 
You can pass the specified rows id to next page..
And getting the rows values from database based on that id...


or

you can set all the fields into properties of one class
and assign these class to one session variable.
And access this session from another page...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900