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

Forums / Deployment / Uploading a dll for extension of Search Result control

Uploading a dll for extension of Search Result control

5 posts, 0 answered
  1. Adam Wildman
    Adam Wildman avatar
    2 posts
    Registered:
    26 Oct 2009
    26 Oct 2009
    Link to this post

    I am trying to upload a dll for a control that I wrote that extends the search result control.  I need the search results to direct to a news article with ta custom URL.  I am attempting to upload the control using the mechanism provided when you are editing a page.  When I try and upload the dll, I get the following error:

    "Unable to cast object of type 'Telerik.Search.WebControls.SearchResultToolboxItem' to type 'System.Drawing.Design.ToolboxItem'."

    The dll still ends up in the bin directory, but there is no toolbox item to use from within the edit page interface.  I have also attempted to directly copy the dll into the bin directory but don't know what th;e web.config entry should look like in the toolbox area.  Am I missing something in the dll? Can you give me an example of what the web.config entry should look like for uploading the control manually?

    Any help on this issue would be greatly appreciated.

    Adam

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Oct 2009
    Link to this post
    Hi Adam Wildman,

    You need to add toolbox item for your dll control.

    Sample code:

    [ToolboxItem ( typeof ( CustomSearchBoxToolboxItem ) )]
    public class CustomSearch : SearchBox
    {
     
    }

    Toolbox class

    public class CustomSearchBoxToolboxItem : ToolboxItem
        {
            #region Construction
            /// <summary>
            /// Creates new instance of the SearchBoxToolboxItem
            /// </summary>
            public CustomSearchBoxToolboxItem ()
                : base(typeof(CustomSearch))
            {
                base.DisplayName = "DisplayName";
                base.Description = "Description";
                     base.Company     = "CustomSection";
     
            }
            #endregion
        }


    Here is how the web.config should looks like( we assume that we use a code from App_Code.)

    <add name="PollsCustumized" section="Custom" type="PollsCustumized, App_Code" />


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Adam Wildman
    Adam Wildman avatar
    2 posts
    Registered:
    26 Oct 2009
    26 Oct 2009
    Link to this post
    Thanks for your help so far.  I have uploaded the new control to the bin directory and updated the web.config file. There is now an "Error Loading Control" in the section of controls I uploaded it to and the tooltip says "Could not load type 'xx_CustomSearchControl' from assembly 'App_Code'."  Any thoughts?
    Thanks,
    Adam
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Oct 2009
    Link to this post
    Hello Adam Wildman,

    If the control is in your bin, why you are adding reference to App_Code folder - "Here is how the web.config should looks like( we assume that we use a code from App_Code.)"

    The syntax is type="NAMESPACE, ASSEMBLY"
     
    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Biren
    Biren avatar
    23 posts
    Registered:
    02 Nov 2010
    05 Nov 2010
    Link to this post
    Hi Adam/Ivan,
    This thread saved me lot of time !!

    Thanks.
Register for webinar
5 posts, 0 answered