Click here to Skip to main content
15,846,144 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
well i have a gridview on a page which gets its data from a database and when the user selects the gridview row then that gridview row should be redirected to a new page.
this new page has another gridview which i need to populate with the selected gridview from previous page.
can somebody help me with this
Posted
Comments
Sergey Alexandrovich Kryukov 29-May-12 16:29pm    
Just one note: don't pass a row or anything related to UI, pass data; separate concerns.
--SA
db7uk 29-May-12 17:50pm    
Yes, as SAKryukov states this is the best option. I think what you need to do is in your gridview create a hyperlink column with the navigation property to your new page. Your binding should also add the data item id in the querystring of the hyperlink.

i.e. NavigationTarget="yourwebpage.aspx?dataId='<%# eval("dataItemId")%>'" Once you do this you can load your data again but only use that which matches the id in the query string????
morojele 30-May-12 2:28am    
thanks
RDBurmon 30-May-12 3:07am    
Hello morojele , Hope you have got answer for your question , but look the thread is still open. If you have implemented your solution and it worked fine for you and as per your expectation .Then add the solution here also and accept it by your own so that This question will mark as solved and other member get know the right solution if they have the same question. Agreed !!!. You can add it by using "Add solution" option.

1 solution

You would need one of the state management techniques to pass on the data from one page to other.

Have a look at these and pick the one that suits you.
MSDN: ASP.NET State Management Overview[^]
State management in ASP.NET - 1[^]
ASP.Net State Management Techniques - 2[^]
 
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