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

Forums / Developing with Sitefinity / Runtime exception While creating index for Products

Runtime exception While creating index for Products

11 posts, 0 answered
  1. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    08 Dec 2008
    Link to this post
    I am trying to create the product index as given in the blog post

     http://www.sitefinity.com/help/developer-manual/products-module-simple-implementation.html

    I am able to create products but while trying to create index on products an exception causing the exception is

    A required control was not found in the template for "Telerik.Samples.Products.WebControls.Search.ProductsIndexSettingsControl+ControlContainer". The control must be assignable form type "System.Web.UI.WebControls.ListControl" and must have ID "productsProvider".


    I followed the guide lines given in the post.I dont know where did i went wrong.
    Can any one please help me to fix this.

    Venkat
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Dec 2008
    Link to this post
    Hello Venkat,

    With which version you are currently working? I tested the Products module in 3.5 and everything works fine. The error you are getting seems to be problem related to the templates or you have missed something.

    I am attaching the working module(with references to Sitefinity version 3.5 assemblies).

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    10 Dec 2008
    Link to this post
    Hai Ivan Thank you for your reply.

    I replaced my project with the zip file you attached here. but still getting the same error.

    error while getting the providername

    public ListControl ProviderName

    {

    get

    {

    if (providerName == null)

    providerName = FindRequiredControl<ListControl>("productsProvider");

    return providerName;

    }

    }


    in ProductIndexSetingsControl.cs

    same error appearing ,when trying to add product index as a source to the search index.
     
    one thing I forgot to mension is I am able to add and update product.But not able to create index on Products.

    Thank you
    Venkat
  4. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    10 Dec 2008
    Link to this post
    Hi Ivan,

    I think ,I did some mstakes in configuration .

    can u please send me the web.config changes  after adding this project to my sitefinity website.

    Thank you
    Venkat
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Dec 2008
    Link to this post
    Hi Venkat,

    Could you check whether there is a DroipDown with ID="productsProvider" in ProductsIndexSettingsControl.ascx template? Check your settings. The module works at my end.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    11 Dec 2008
    Link to this post
    Hi Ivan ,

    Thank you for your reply! it helped me alot.

    In my website am not able to find these usercontrols .I did not find these files in the downloaded zip folder also.

    ~/Sitefinity/Admin/ControlTemplates/Products/ProductsIndexViewSettingsControl.ascx

    ~/Sitefinity/Admin/ControlTemplates/Products/ProductsIndexSettingsControl.ascx


    I created the second user control ,then it worked fine.But I want the exact coding logic.

    can you please send me those files or give me guide lines to implement those files by my own.

    Thank you.
    Venkat
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Dec 2008
    Link to this post
    Hi Venkat,

    Find the attached templates as zip archive. These files are templates for the controls in the products module. You also need to have resx file in a place.
    ProductsIndexSettingsControl.cs.  is a standard control in Sitefinity, so can gather more information throughout our developer’s manual. The specific here is that the control must implement ISettingsControl interface and this interface

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    12 Dec 2008
    Link to this post
    Ivan, thank you for your patience.

    Its asking for resource files for those two usercontrols.

    can you please send me the resourse files also.

    please send me all the resourse for the products module.

    Thank you very much.
    Venkat
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 Dec 2008
    Link to this post
    Hello Venkat,

    Please go to the Developers Manual from where you have download the project. All files should be there. check out the following blog post In the mean time series (part 4): BONUS TRACK - "Products" module - implementing search index

    I hope this helps.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    12 Dec 2008
    Link to this post
    Ivan ,

    At last I am able to create and update products and able to create indexes on products and succeded in searching also.

    But When I am trying to edit the existing ProductIndex, it is giving the following error

    The given key was not present in the dictionary.

    Can you please give me a clue to solve this ..!

    Thank you once again.
    Venkat

  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    15 Dec 2008
    Link to this post
    Hi Venkat,

    Open ProductsIndexSettingsControl is located under ~\WebControls\Search\ProductsIndexSettingsControl.cs

     Change Products.Index.SettingsControl.settings as below:

            if (settings != null && settings.Count > 0) 
                { 
                    ctrlContainer.ProviderName.SelectedValue = ProviderName = settings["ProductIndexProvider"]; 
                    ctrlContainer.SingleProductUrl.Text = settings["ProductPageUrl"]; 
                } 

    I hope this helps.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
11 posts, 0 answered