Can't add SearchBox to page

Posted by Community Admin on 03-Aug-2018 00:05

Can't add SearchBox to page

All Replies

Posted by Community Admin on 08-Oct-2011 00:00

I have a very simple page which I have added a SearchBox to.  Now matter what I do though, I get a designer type initialization error:

The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception.

How can I resolve this so that I can place the SearchBox on my page?  The simple mark-up from the page is pasted below.

Thanks,
Stephen


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SitefinityWebApp.WebForm1" %>
<%@ Register TagPrefix="search" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Services.Search.Web.UI.Public" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <search:SearchBox ID="SearchTextBox" SearchIndexPipeId="87904a9c-f50c-4a60-ba59-fa72f209d61b" BinderBoxLabelText="" UseSearchButton="true" IndexCatalogue="All" ResultUrl="~/search-results" runat="server" />
    </div>
    </form>
</body>
</html>

Posted by Community Admin on 11-Oct-2011 00:00

Hello Stephen Long,

Is the page to which you add the searchbox part of a Sitefinity website or is this page external to the web application? Please note that this control cannot be used outside of a Sitefintiy website. Also the SearchBox implements IScriptControl a script manager on the page. The bellow markup works, when the ASPX page is ran in the context of a Sitefinity 4.x website:

<asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
<search:SearchBox ID="SearchTextBox" SearchIndexPipeId="87904a9c-f50c-4a60-ba59-fa72f209d61b" BinderBoxLabelText="" UseSearchButton="true" IndexCatalogue="All" ResultUrl="~/search-results" runat="server" />



Kind regards,
Radoslav Georgiev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed