I have a database where i am displaying books. Main page displays 2 links category( fiction, technical)
You click on technical then it takes you to a new page where it queries the technical books
From there i am using a repeater to display those technical books.. including the picture.
My question is i want to be able to make the name a link and when the user clicks that link some variable knows the name and i am taken to a new page where then i could use that variable to query the database to display the right information again. Im not sure if a variable is the way to go.
Or, if query string could work – something like:
Server.UrlDecode(Request.QueryString["BookName"]);
So, i guess there are 2 questions..
-
How do i make name a link and navigate to the new page “Book.aspx”
-
how can i save that name that is clicked so the book page would know it(name) so i could use that name in a query ?
Here is what i have..
<h2>Books in category</h2>
<p> </p>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<div>
<img src='/images/<%# DataBinder.Eval(Container.DataItem, "Image") %>' onclick="Navigate()"
alt="" align="left" style="height:100px;width:100px;border:1px solid black" />
</div>
<table class="vertaligntop">
<tr >
<td >
<%# DataBinder.Eval(Container.DataItem, "BookName") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "BookDescription") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "ISBN") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "Author") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "CategoryName") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "Publisher") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "Rating") %>
<br />
<%# DataBinder.Eval(Container.DataItem, "Price") %>
<br />
</td>
In aspx page change data bind for
BookNameas:And in your code behind of the next page, save
BookNameintoViewStateand use it when it is required: