Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can continue to use your empty string value and I would tend to prefer this to an assigned value, even though -1 is usually a good choice since it's highly unlikely that one of your filters would be using that as a value. I would clean up your query string though by calling something like the following function: </p> <pre><code>Private Function AppendFilter(ByVal filterName As String, ByVal filterVal As String, ByVal query As String) As String Dim res As String = query If filterVal.Length() &gt; 0 Then res = IIf(query.Length() &gt; 0, query &amp; "&amp;", query) &amp; filterName &amp; "=" &amp; filterVal End If Return res End Function </code></pre> <p>instead of this line from your code: <code>queryString = selectedAuthorString &amp; "&amp;" &amp; selectedSubjectString &amp; "&amp;" &amp; selectedTypeString</code></p> <p>Your resulting code would look like this: </p> <pre><code>Protected Sub buttonFilterGo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonFilterGo.Click Dim queryString As String = "" Const PATH As String = "~/paper/browse/?" queryString = AppendFilter("author", dropAuthorList.SelectedItem.Value, queryString) queryString = AppendFilter("subject", dropSubjectList.SelectedItem.Value, queryString) queryString = AppendFilter("type", dropPaperType.SelectedItem.Value, queryString) If queryString.Length() &lt;= 0 Then labelFilterFeedback.Text = "Apply some filters then press Go" Else Response.Redirect(PATH &amp; "?" &amp; queryString) labelFilterFeedback.Text = "" End If End Sub </code></pre> <p>And your query string won't contain filters that aren't applicable. </p>
    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