Can't add SearchBox to page
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">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
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
>
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"
/>