I’m making an Online Library Management System using ASP.NET (with C#). So far everything is ok (I’ve made some search function that display search results in gridview). No what I want to do is that when a user click or select a book from the gridview (in a new page) I want it to be displayed in detailsview to see all the details and foreign keys associated with it. Any help would greatly appreciated 😉 Thanks in advance.
I’m making an Online Library Management System using ASP.NET (with C#). So far everything
Share
If the DetailsView were on the same page, you would be able to use the SelectedValue of the GridView to get the ID of the selected item, and use that to bind your DetailsView. There’s a tutorial on http://www.asp.net that covers this:
http://www.asp.net/learn/webcasts/working-with-the-gridview-and-detailsview-controls-in-aspnet-20
To open it in a new page, you would add a
<asp:HyperLinkField>to the<columns>colleciton of your GridView:This will pass the field
BookIDfrom that item to your other page as a URL parameter namedBookID.