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

Forums / 3.x Pre-release forums (retired) / Telerik.WebModule class error

Telerik.WebModule class error

8 posts, 0 answered
  1. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    30 Apr 2007
    Link to this post

    The RC1 projects seem to have converted correctly except one error in our Telerik.WebModule classes.

    Private toolboxItems As ToolboxItemCollection  
     
        Public Overrides ReadOnly Property Controls() As ToolboxItemCollection  
            Get 
                Initialize()  
                If toolboxItems Is Nothing Then 
                    toolboxItems = New ToolboxItemCollection(New ToolboxItem() {New CmsToolboxItem("~/Common/Alighten/Contacts/contact.ascx""Contacts""Contact Form""Allows clients to contact BAI for request.")})  
                End If 
     
                Return toolboxItems  
            End Get 
        End Property 
     

    The property that loads the toolbox item collection no longer works. Can you let me know how this should look now?

    Sincerely,

    Ben
  2. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    30 Apr 2007
    Link to this post
    Hi Ben,

    You need to change it to something like this.

    Public Overloads Overrides ReadOnly Property Controls() As IList(Of IToolboxItem) 
        Get 
            Return New List(Of IToolboxItem)(New ToolboxItem() {New CmsToolboxItem("~/Common/Alighten/Contacts/contact.ascx", "Contacts", "Contact Form", "Allows clients to contact BAI for request.")}) 
        End Get 
    End Property 
     


    Plus you will need to add Imports Telerik.Web at the top of the class file if it is missing...

    I haven't tested this and also had to convert it to VB.net so I hope the syntax is all correct... if not I am sure you will figure it out...

    Hope it helps anyways.

    Cheers
    Sean
  3. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    30 Apr 2007
    Link to this post
    Nice Sean. It compiles and runs now.

    The toolbox controls appear on the page. However I am getting the following error when trying to access my modules ControlPanel.ascx from the Sitefinity backend.

    The given key was not present in the dictionary.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    Source Error:

    Line 42: 	protected void Page_Load(object sender, EventArgs e)
    Line 43: 	{
    Line 44: 		if (base.Module != null)
    Line 45: 		{
    Line 46: 			this.contolPanel = base.Module.CreateControlPanel(this);

    Source File: c:\Program Files\telerik\Sitefinity3.0\WebSites\BAI5000\Sitefinity\Admin\Modules.aspx.cs    Line: 44

    Stack Trace:

    [KeyNotFoundException: The given key was not present in the dictionary.]
       System.ThrowHelper.ThrowKeyNotFoundException() +28
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +2635380
       Telerik.Cms.Web.ModulesAdminPage.get_Module() +185
       Modules.Page_Load(Object sender, EventArgs e) in c:\Program Files\telerik\Sitefinity3.0\WebSites\BAI5000\Sitefinity\Admin\Modules.aspx.cs:44
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       Telerik.Cms.Web.AdminPage.OnLoad(EventArgs e) +71
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
    

    Is there a change to the web.config that i need to make?

    Sincerely,

    Ben



  4. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    30 Apr 2007
    Link to this post
    Hi Ben,

    Telerik have made some pretty big changes to the way the Modules work, and the Developer Manual hasn't been updated to reflect those changes, so I am no expert on these matters.

    But if I had to hazard a guess I would look at this section of the web.config, you will need to add your module to this section

        <framework> 
                <modules> 
                    <add type="Telerik.Cms.Engine.GenericContentModule, Telerik.Cms.Engine"/> 
                    <add type="Telerik.News.NewsModule, Telerik.News"/> 
                    <add type="Telerik.Blogs.BlogsModule, Telerik.Blogs"/> 
                    <add type="Telerik.Lists.ListModule, Telerik.Lists"/> 
                    <add type="Telerik.Polls.PollModule, Telerik.Polls"/> 
            
                <assemblies> 
                </assemblies> 
            </framework> 

    But I suspect that will not be the only problem you will run into, as they have made some changes to the way the permissions work and the way that the Data Connections are initialised, so you might be better off waiting for them to let you know what you need to change, and they probably won't be able to do it in a single post....

    But you could give the changes a go and see how far you get?
  5. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    30 Apr 2007
    Link to this post

    I didn't notice initially, but I also get the following error after the upgrade. Clicking on any Page in the Pages SiteMap treeview gives the following error.

    Key cannot be null.
    Parameter name: key

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentNullException: Key cannot be null.
    Parameter name: key

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ArgumentNullException: Key cannot be null.
    Parameter name: key]
       System.Collections.Hashtable.get_Item(Object key) +2842181
       Telerik.Cms.Web.UI.HeaderTag.GetAllAttributes() +23
       Telerik.Cms.Web.UI.TagAttributes.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +224
       System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
       System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
       Telerik.Cms.Web.UI.HeaderTag.DataBind() +222
       Telerik.Cms.Web.UI.HeaderTags.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +275
       System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
       System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
       Telerik.Cms.Web.UI.PageProperties.Select(IPage cmsPage) +1241
       Telerik.Cms.Web.UI.PageEditorBase.BindPageControls() +333
       Telerik.Cms.Web.UI.PageEditorBase.Select(IPage page) +34
       Telerik.Cms.Web.UI.PageEditorBase.Select(Guid pageId) +210
       Telerik.Cms.Web.UI.SiteMapPanel.submit_Command(Object sender, CommandEventArgs e) +745
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +105
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
    

    Sincerely,

    Ben

  6. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    01 May 2007
    Link to this post
    OK I deleted all of the additional Meta Tags and then recopied the database over to the new project folder and now the Page Error no longer occurs.

    Now it's just the module error.

    Sincerely,

    Ben
  7. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    02 May 2007
    Link to this post
    Hi bnye,

    Is your module intra-site or precompiled?
    If your module is precompiled, then everything said by Sean is absolutely correct and you should be able to run it without any problems.

    Unfortunately, we just discovered a bug with intra-site modules.
    If your module is intra-site, please rename it with lower case letters only (the Name property of the WebModule class).

    Let us know if this does not solve the problem.

    All the best,
    Bob
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    02 May 2007
    Link to this post
    It's an intra-site module. And that fixed it.

    Thank you very much.

    Sincerely,

    Ben
Register for webinar
8 posts, 0 answered