More in this section

Forums / Developing with Sitefinity / I want to Display the Size of the page in Search results page.

I want to Display the Size of the page in Search results page.

2 posts, 0 answered
  1. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    21 Apr 2009
    Link to this post


      Hi,

      We are using Sitefinity 3.6. and our requirement is ,In our application we want to show the page size of each search result item that is showing in the search results page.

     How can I achieve this using site finity existing controls.

    Thanks
    Venkat
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Apr 2009
    Link to this post
    Hello Venkat,

    You can create a custom control with the following logic:
    int count;   
    IList<Telerik.Search.Engine.ResultItem> results = Telerik.Search.Engine.SearchManager.Search(q, "SearchTerm", 0, 10, "AnyWord"out count);   
    if (count == 0)   
         rptResults.Visible = false;   
    else   
    {   
         rptResults.DataSource = results;   
         rptResults.DataBind();   
    }   
     
    rptResults is the repeater which will show the results from this search. There is a URL property of each ResultItem (hold in the results). You can create a web request for example to each ResultItem.Url, and take the length of the Response.

    I hope this helps.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered