SearchBox - Client-side Templates

Welcomes you to dinner on !

Please RSVP by calling

We will be expecting you at

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

RadSearchBox provides support for client templates. The template itself contains mark up and/or binding expressions which are evaluated against a DataItem and then rendered on the client.

  • DefaultVB.aspx
  • scripts.js
  • styles.css
<%@ Page Inherits="Telerik.QuickStart.QsfPage"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
    <script type="text/javascript" src="scripts.js"></script>

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

    <div class="demo-container no-bg">

        <telerik:RadODataDataSource runat="server" ID="RadODataDataSource1">
                <Read Url="" DataType="JSONP"></Read>
                <telerik:DataModel ModelID="Employee" Set="Employees">
                    <telerik:DataModelField FieldName="City" />
                    <telerik:DataModelField FieldName="Address" />
                    <telerik:DataModelField FieldName="LastName" />
                    <telerik:DataModelField FieldName="FirstName" />
                    <telerik:DataModelField FieldName="HomePhone" />
                    <telerik:DataModelField FieldName="City" />
                    <telerik:DataModelField FieldName="TitleOfCourtesy" />
                    <telerik:DataModelField FieldName="BirthDate" />
                    <telerik:DataModelField FieldName="PostalCode" />
                    <telerik:DataModelField FieldName="Country" />

        <div class="searchBoxContainer">

            <telerik:RadSearchBox RenderMode="Lightweight" runat="server" ID="RadSearchBox1" Width="350" Skin="Silk"
                DataTextField="FirstName" OnClientSearch="OnClientSearch"
                ODataDataSourceID="RadODataDataSource1" DataKeyNames="Address,Phone,TitleOfCourtesy,BirthDate,PostalCode,Country" DataModelID="Employee">
                <DropDownSettings Height="400px">
                    <h3>#= Text # #= DataItem.LastName #</h3>
                    <div class="details">
                        <img src="icon_list.png" alt="Alternate Text" style="float:left; height:36px; width:36px;" />
                        <span class="info">
                                <b>Address:</b> #= DataItem.Address #<br>
                                <b>Contact Phone:</b> #= DataItem.HomePhone #

        <div class="dinnerDetails">
                Welcomes you to dinner on <span class="date"></span>!
                Please RSVP by calling
                <br />
                <span class="phone"></span>
                We will be expecting you at
                <br />
                <span class="address"></span>.


Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?