Virtual Happy Hour is canceled this month (March) due to Good Friday.
Virtual Happy Hour is canceled this month (March) due to Good Friday.
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:http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2/Page-Providers/
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.
Hi,
Thanks for the Reply. Yes I have registered customPageProvider.
capabilities="Edit,Search".
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)
return;
PageData searchPage = GetPage(searchPageRef);
Response.Redirect(String.Format("{0}&quicksearch={1}", searchPage.LinkURL, searchText));
}
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. http://world.episerver.com/Blogs/Deane-Barker/Dates/2010/12/Lucene-Search-for-EPiServer/
Hi,
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));
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.
Edit: I suggest you use UriSupport.AddQueryString(string url, string name, string value) to add query parameters to an existing URL.
Hi,
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?
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.
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...............: