SearchBox Exception in VS 2010 Designer - Sitefinity 4.4

Posted by Community Admin on 04-Aug-2018 11:02

SearchBox Exception in VS 2010 Designer - Sitefinity 4.4

All Replies

Posted by Community Admin on 10-Apr-2012 00:00

Hi there, 

We created a custom user control to construct a custom menu and want to add the Sitefinity SearchBox to it as follows: 

<sfSearch:SearchBox ID="SitefinitySearch" runat="server" ResultsUrl="/search" SearchIndexPipeId="xxx-xxx-xxxx-xxxxx">
        <LayoutTemplate>
            <fieldset class="sfsearchBox">
                <asp:TextBox ID="searchTextBox" runat="server" CssClass="sfsearchTxt" />
                <asp:Button ID="searchButton" runat="server" Text="" OnClientClick="return false;" CssClass="sfsearchSubmit" />
            </fieldset>
        </LayoutTemplate>
    </sfSearch:SearchBox>
This code is inside a user control called SubNavigation.ascx and has the correct @ Register declaration as follows: 
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Services.Search.Web.UI.Public" TagPrefix="sfSearch" %>

This actually works when we register the control in Sitefinity and put it into a page. It redirects to the right page, performs the search and so forth so everything is fine. 

But we noticed that none of the controls in our User Control were accessible in C# due to the designer file not being updated. After troubleshooting we see now that when we remove the Sitefinity SearchBox control the designer file is correctly updated and controls become accessible from C#. Put the SearchBox back and the problems start again. 

When you switch to design view the control itself throws the exception: "The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception. 

I've removed all the attributes of the control and the templated section and it still does the same thing. 

Is this a bug? Is it fixable? 

Regards,
Jacques

This thread is closed