Problem with Page Provider and Search


Hi ,

I have a pageProvider in my code.With the help of which I am retrieving productinfo of various products in my database.

There is a usercontrol of SearchBox in my page. Search is working in everypage except the Pages which came from providers.

when I hit search Page get refreshed and same pagecome agin and againinspite of redirecting to searchPage with qurystring value?

Please Help...............:


Dec 20, 2010 11:29

Let's take this from the top.

You have implemented a custom PageProvider to serve product pages from a database. Question: have you registered the custom PageProvider with search-capability?

For example:


<add name="CustomPageProvider" type="Some.Namespace, Assembly" entryPoint="999" capabilities="Edit,MultiLanguage,Search"></add>

The custom page provider must also implement FindPagesWithCriteria. See the following post for more information:

As for the redirect - I don't really understand what you're doing there? Are you doing Response.Redirect(someUrl)?

Edit: Note that custom page providers are not indexed and you cannot use full-text search for these.You could look into using Lucene.Net to implement functionality for this.

Edited, Dec 20, 2010 12:54


Thanks for the Reply. Yes I have registered customPageProvider.


It was just a Episerver Search in the page Left Menu. which is working in all the pages except the PageProvider.

 protected void SearchClick(object sender, EventArgs e)
            string searchText = Server.UrlEncode(tbxQueryBox.Text.Trim());
            PageReference searchPageRef = CurrentPage["SearchPage"] as PageReference;
            if (searchText == null || searchText.Length == 0 || searchPageRef == null)

            PageData searchPage = GetPage(searchPageRef);
            Response.Redirect(String.Format("{0}&quicksearch={1}", searchPage.LinkURL, searchText));


Dec 20, 2010 13:04

Pages served by custom page providers are not indexed for full-text search, unfortunately. You could look into Deane Barker's approach of using Lucene.Net to index files & pages in EPiServer.

Dec 20, 2010 13:21


This means the pages in the provider is not indexable. But I am not indexing the providers page.  Response.redirect should redirect it to diffrent page with the querystring value.

Response.Redirect(String.Format("{0}&quicksearch={1}", searchPage.LinkURL, searchText));

Dec 20, 2010 13:35

Yep. Have you checked so that you're not returning early and not hitting Response.Redirect?

I'm guessing that CurrentPage["SearchPage"] as PageReference resolves as Null.

Dec 20, 2010 13:59

Edit: I suggest you use UriSupport.AddQueryString(string url, string name, string value) to add query parameters to an existing URL.

Edited, Dec 20, 2010 14:01


Thanks for the reply.

U are right

 PageReference searchPageRef = CurrentPage["SearchPage"] as PageReference; here the searchPageRef is null only in the page creted by page provider. How do I get the pagerefrence of that page?

Dec 28, 2010 10:13

Either the SearchPage-property needs to exist on the current page or it should be set as a dynamic property.

An option would be to create a "Site Settings"-section on the start page. You can always access the start page reference via PageReference.StartPage. By doing so you can retrieve the start page and access any site-wide properties you may need.

Jan 03, 2011 8:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.