Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I populate a listview based on 2 boolean table columns?
    primarykey
    data
    text
    <p>I have a database table containing scripts for plays/dramas. The scripts can be categorized under 'Theatre and Education', 'Plays for Young People' or both (by using bools to determine whether they belong to said categories);</p> <ul> <li>scriptID: int </li> <li>theatreAndEducation:bit </li> <li>playsForYoungPeople: bit</li> <li>scriptTitle: varchar </li> <li>scriptSample:text</li> <li>thumbImageUrl: varchar</li> </ul> <p>In the main menu I have a drop down list which contains the following links;</p> <ul> <li>a runat="server" href="~/WebForm/scriptList">theatre &amp; education</li> <li>a runat="server" href="~/WebForms/scriptList">plays 4 young people</li> </ul> <p>When the user clicks one of these links, they are taken to a page which contains a listview. I would like this listview to be populated with the records that correspond to the link that was clicked. </p> <p>I'm guessing that a querystring is needed but I can't think an appropriate one that can be used.</p> <p>Below is the listview in its current state. Any ideas on a query string and how the sql datasource should be configured to display the appropriate script records based on the link which is clicked?</p> <pre><code>&lt;asp:ListView ID="scriptsListView" runat="server" DataSourceID="SqlDataSource1"&gt; &lt;LayoutTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;title&lt;/td&gt; &lt;td&gt;summary&lt;/td&gt; &lt;td&gt;image&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;asp:PlaceHolder ID="itemPlaceholder" runat="server"&gt; &lt;/asp:PlaceHolder&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/LayoutTemplate&gt; &lt;ItemTemplate&gt; &lt;tr&gt; &lt;td&gt;&lt;%# Eval ("scriptTitle") %&gt;&lt;/td&gt; &lt;td&gt;&lt;%# Eval ("scriptSample") %&gt;&lt;/td&gt; &lt;td&gt;&lt;asp:Image ID="image" runat="server" ImageUrl='&lt;%# "~/Images/Scripts/" + Eval("thumbImageUrl") %&gt;' /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:ConnectionString %&gt;" SelectCommand=""&gt; &lt;SelectParameters&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload