+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / UpdatePanel in SearchResults Web User Control

UpdatePanel in SearchResults Web User Control

4 posts, 0 answered
  1. Brian
    Brian avatar
    2 posts
    Registered:
    12 Mar 2009
    27 Jan 2011
    Link to this post
    When using a created SearchResults.ascx in conjunction with the default Search page, I am unable to wrap an ASP.NET AJAX Update Panel around the results. While the UpdatePanel works with custom controls placed on the page, it is unable to find controls that are referred to from Search such as the asp:Literal "ResultsStats" 

    A required control was not found in the template for "~/UserControls/Product/searchresults.ascx". The control must be assignable form type "System.Web.UI.Control" and must have ID "ResultsStats".

    Is there somewhere on the ascx that I can identify these controls so they are found by the referring search page?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Jan 2011
    Link to this post
    Hello Brian,

    When you wrap ResultsStats inside another control our container that is defined inside SearchResult control cannot find the ResultsStats ( which is  require control).
    The solution will require to override CreateChildControls from SearchResults control and replace the base logic with a custom one where you search the control recursively.

    You might find this post useful.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Brian
    Brian avatar
    2 posts
    Registered:
    12 Mar 2009
    28 Jan 2011
    Link to this post
    Thanks Ivan,

    Although after scouring that other post and trying to replicate the custom search results on there...I eventually whittled it down to 

        protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }

    From there, I cannot for the life of me figure out how to recursively find the ResultsStats and other controls.
    Also, wouldn't the UpdatePanel define the new container, and could the controls be provided in its PreRender or Load for the Search to find?

    Any chance there are examples of ResultsStats, rptResults, and Pager being exposed when wrapped in an ASP.NET UpdatePanel for async postback? I couldn't even find any examples of ResultsStats being used.

    Thank you.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Jan 2011
    Link to this post
    Hi Brian,

    Actually you can implement the code from the forum post. Inside the controls container you need to add your panel and then search for the controls inside it. The post also shows how to create a custom container.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered