not displaying search results correctly from querystring keyword
<p>I had a basicSearch page working perfectly with the keyword searching (highlighting the keyword on the search result page) but when I modified it to work with a querystring, it's displaying ALL the records with the keyword highlighted.</p>

<p><strong>aspx page:</strong></p>

<pre><code>&lt;form id="form1" runat="server"&gt;

&lt;div id="mainContent"&gt;
    &lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt;

    &lt;script type="text/javascript"&gt;
        function updated() {
            //  close the popup
            tb_remove();

            //  refresh the update panel so we can view the changes  
            $('#&lt;%= me.btnRefreshResources.ClientID %&gt;').click();
        }

        function pageLoad(sender, args) {
            if (args.get_isPartialLoad()) {
                //  reapply the thick box stuff
                tb_init('a.thickbox');
            }
        }
    &lt;/script&gt;  

    &lt;asp:AccessDataSource ID="AccessDataSource" runat="server" 
        DataFile="~/Dir/search.mdb" 
        SelectCommand="SELECT * FROM [searches] ORDER BY [Title]"  
        FilterExpression="Title like '%{0}%' or LastName like '%{1}%' or FirstName like '%{2}%' or Description like '%{3}%' "&gt;

        &lt;FilterParameters&gt;
            &lt;asp:ControlParameter Name="Title" ControlID="txtSearch" PropertyName="Text" /&gt;
            &lt;asp:ControlParameter Name="LastName" ControlID="txtSearch" PropertyName="Text" /&gt;
            &lt;asp:ControlParameter Name="FirstName" ControlID="txtSearch" PropertyName="Text" /&gt;
            &lt;asp:ControlParameter Name="Description" ControlID="txtSearch" PropertyName="Text" /&gt;
        &lt;/FilterParameters&gt;
    &lt;/asp:AccessDataSource&gt;

    &lt;div id="basicSearch" align="left"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
        &lt;b style="font-family: Arial, Helvetica, sans-serif; font-size: 18px"&gt;Enter a keyword: &lt;/b&gt;&lt;asp:TextBox ID="txtSearch" runat="server" Width="300px" Font-Size="18px" /&gt;&amp;nbsp;&amp;nbsp;
        &lt;asp:Button ID="btnBasicSearch" Text="Search" Runat="Server"/&gt;&amp;nbsp;&amp;nbsp;
        &lt;asp:Button ID="btnBasicClear" Text="Clear" Runat="Server"/&gt;&lt;br /&gt;&lt;br /&gt;
    &lt;/div&gt;

&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
    &lt;ContentTemplate&gt;      
        &lt;asp:Button ID="btnRefreshResources" runat="server" style="display:none" OnClick="Refresh_Click" /&gt; 

    &lt;asp:GridView ID="gvResources" runat="server" DataSourceID="AccessDataSource" CssClass="datagrid" GridLines="None" AutoGenerateColumns="false" AllowSorting="True" PageSize="50" AllowPaging="True" Width="100%"  OnPageIndexChanging="gvResources_PageIndexChanging"&gt; &lt;PagerSettings Position="TopAndBottom" /&gt;
    &lt;Columns&gt;
    &lt;asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" /&gt;

    &lt;asp:TemplateField HeaderText="Type" HeaderStyle-HorizontalAlign="Right" SortExpression="Title"&gt;
        &lt;ItemTemplate&gt;
            &lt;%# DisplayType(Eval("Book"))%&gt;
        &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField HeaderText="Title" SortExpression="Title"&gt;
    &lt;ItemTemplate&gt;
        &lt;asp:Label ID="lblTitle" Text='&lt;%# HighlightText(Eval("Title").ToString()) %&gt;' runat="server" /&gt;
    &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField HeaderText="Last Name" SortExpression="LastName"&gt;
    &lt;ItemTemplate&gt;
        &lt;asp:Label ID="lblLastName" Text='&lt;%# HighlightText(Eval("LastName").ToString()) %&gt;' runat="server" /&gt;
    &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField HeaderText="First Name" SortExpression="FirstName"&gt;
    &lt;ItemTemplate&gt;
        &lt;asp:Label ID="lblFirstName" Text='&lt;%# HighlightText(Eval("FirstName").ToString()) %&gt;' runat="server" /&gt;
    &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField HeaderText="Description"&gt;
    &lt;ItemTemplate&gt;
        &lt;asp:Label ID="lblDescription" Text='&lt;%# HighlightText(Eval("Description").ToString()) %&gt;' runat="server" /&gt;
    &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField&gt;
        &lt;ItemTemplate&gt;
            &lt;a id="btnShowPopup" runat="server" class="thickbox" title='&lt;%# Eval("ID", "Request Resource ID: {0}") %&gt;' href='&lt;%# Eval("ID", "RequestResource.aspx?ID={0}&amp;TB_iframe=true&amp;height=350&amp;width=500&amp;modal=true") %&gt;'&gt;Request This Item&lt;/a&gt; &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

    &lt;/Columns&gt;
&lt;/asp:GridView&gt;
&lt;/ContentTemplate&gt;
&lt;/asp:UpdatePanel&gt; 
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p><strong>Code behind:</strong></p>

<pre><code>Partial Class BasicSearch

Inherits System.Web.UI.Page

Dim SearchString As String = ""

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    SearchString = Request.QueryString("Keyword")
End Sub

Protected Sub Refresh_Click(ByVal sender As Object, ByVal args As EventArgs)
    ' update the grids contents
    Me.gvResources.DataBind()
End Sub

Function HighlightText(ByVal InputTxt As String) As String
    If SearchString = "" Then
        Return InputTxt
    Else
        Dim ResultStr As Regex
        ResultStr = New Regex(SearchString.Replace(" ", "|"), RegexOptions.IgnoreCase)
        Return ResultStr.Replace(InputTxt, New MatchEvaluator(AddressOf ReplaceWords))
    End If
End Function

Public Function ReplaceWords(ByVal m As Match) As String
    Return "&lt;span class=highlight&gt;" + m.ToString + "&lt;/span&gt;"
End Function

Protected Sub gvResources_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
    gvResources.PageIndex = e.NewPageIndex
    SearchString = txtSearch.Text
    gvResources.DataBind()
End Sub

Protected Sub btnBasicSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBasicSearch.Click
    SearchString = txtSearch.Text
    Response.Redirect("BasicSearch.aspx?Keyword=" &amp; SearchString)
End Sub

Protected Sub btnBasicClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBasicClear.Click
    txtSearch.Text = ""
    SearchString = ""
End Sub

Protected Function DisplayType(ByVal Book As Boolean) As String
    If Book Then
        Return "Book"
    Else
        Return "Other"
    End If
End Function
End Class
</code></pre>
