If Me.TextBoxQuickSearch.Text.Length > 0 Then
Dim SearchString As String = Me.TextBoxQuickSearch.Text
If Right(SearchString, 1) = "s" Then
SearchString = SearchString.Remove(SearchString.Length - 1)
End If
Response.Redirect("~/SearchResults.aspx?Search=" & SearchString)
Else
Me.TextBoxQuickSearch.Text = "No Text"
End If
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="QuickSearch.ascx.vb" Inherits="QuickSearch" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="SearchButton">
<div style="z-index: 0">
<table style="width:100px;">
<tr>
<td>
<asp:TextBox ID="TextBoxQuickSearch" runat="server" BackColor="#FFCCFF"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
TargetControlID="TextBoxQuickSearch" WatermarkCssClass="SearchWaterMark"
WatermarkText="Search For A Product...">
</ajaxToolkit:TextBoxWatermarkExtender>
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager2" runat="server">
</ajaxToolkit:ToolkitScriptManager>
</td>
<td align="left">
<asp:ImageButton ID="SearchButton" runat="server"
ImageUrl="~/Images/SiteImages/Search.png" style="height: 22px" />
</td>
</tr>
</table>
</div>
</asp:Panel>
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
Response.Redirect("~/Searc
The false tells it not to end the execution on the current page. This will allow it to finish any pending tasks. The HTMLEncode encodes your search string to a form that can be inserted in the URL. Without it you might find problems with some characters.