Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi frnd,
i search a lot but didn't get anything i am trying to view particular row information into next page when click on that row which in gridview. thx in advance
Posted
Comments
Jignesh Khant 28-May-13 5:30am    
Do u want information to be displayed on click of a link in grid view?
IpsitaMishra 28-May-13 5:47am    
I think you have a grid view where you have a view button .on clicking the view button you want to go to a page where you can see the details of that particular row.
bh@r@t 28-May-13 6:05am    
ya do you have any suggestion
IpsitaMishra 28-May-13 6:49am    
I have added my suggestion as solution ,please have a look :)

Try this code inside your templatefield of the grid view

HTML
<pre lang="xml"><ItemTemplate>
                <button class="view" onclick="window.location='./ViewDetails.aspx?Id=<%# DataBinder.Eval(Container.DataItem,"Id") %>'; return false;"></button>




the Id should be the primary or unique key .
 
Share this answer
 
Use this,

XML
<asp:TemplateField>
<HeaderTemplate>View</HeaderTemplate>
<ItemTemplate>
<a id="lnk" href='ViewDetails.aspx?id=<%# Eval("Id") %>' target="_blank">View Details</a>
</ItemTemplate>
</asp:TemplateField>


in ViewDetails.aspx page get query string value with id name, and retrieve data by using this id and bind your data.
 
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