SearchBox - Server-side Events

Event log

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

Server events supported by RadSearchBox are:

  • OnSearch
  • OnButtonCommand
  • OnDataRequesting
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="SearchBox.Examples.Programming.ServerEvents.DefaultCS" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>

<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">

        <div class="demo-container size-thin">
            <telerik:RadSearchBox RenderMode="Lightweight" ID="RadSearchBox1" runat="server" Width="300px"
                DataSourceID="SqlDataSource1"
                EmptyMessage="Search for product"
                DataKeyNames="UnitPrice"
                DataValueField="ProductId"
                DataTextField="ProductName"
                OnButtonCommand="RadSearchBox1_ButtonCommand"
                OnDataSourceSelect="RadSearchBox1_DataSourceSelect"
                OnSearch="RadSearchBox1_Search"
                ShowSearchButton="true">
                <Buttons>
                    <telerik:SearchBoxButton ImageUrl="../../images/icon_globe.png" CommandName="Globe"
                        CommandArgument="globe" Position="Left" AlternateText="globe" />
                    <telerik:SearchBoxButton ImageUrl="../../images/icon_favourites.png" CommandName="Favorites"
                        CommandArgument="favorites" Position="Right" AlternateText="favorites" />
                </Buttons>
                <DropDownSettings Height="400" Width="300" />
            </telerik:RadSearchBox>
        </div>

        <qsf:EventLogConsole runat="server" ID="EventLogConsole1" AllowClear="true" />

    </telerik:RadAjaxPanel>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Products]"></asp:SqlDataSource>

    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?