Script control '' is not a registered script control

2 posts, 0 answers
  1. Chanan Zass
    Chanan Zass avatar
    63 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2009 Link to this post

    Greetings,

    Here's a strange thing: I have a RadTabStrip with a RadMultiPage all set up and working.
    Moving from one tab to another creates always a new PageView (a userControl).
    Usually all works beautifully. But when we go back a tab, correct certain form data and resubmitting in order to ahead again (recreacting the next PageView), we get the following error message:

    Script control '' is not a registered script control. Script controls must be registered using 
    RegisterScriptControl() before calling RegisterScriptDescriptors().  
    Parameter name: scriptControl 

    This happens only on opening one tab. No problem with any other. The tab in question includes
    - a RadGrid
    - a RadWindowManager (required for editing RadGrid items
    - RadAjaxManager
    - RadAjaxLoadingPanel

    A RadScriptManager is placed in the WebForm (.aspx) page that contains the RadTabStrip.

    As mentioned, when you just move forward from one tab to another there are no problems. That problem happens only when going back one tab and clicking submit again to move forward.

    Any clue?
    Thanks much.
  2. Chanan Zass
    Chanan Zass avatar
    63 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2009 Link to this post

    I've fixed the problem by avoiding the recreation of the new PageView:
    While before I've used this code:
    Dim myTabStrip As RadTabStrip = CType(Page.Master.FindControl("MainPageContent").FindControl("RadTabStrip1"), RadTabStrip)  
    Dim myMultiPage As RadMultiPage = CType(Page.Master.FindControl("MainPageContent").FindControl("RadMultiPage1"), RadMultiPage)  
     
    Dim pageView As New RadPageView()  
    pageView.ID = "MyNewPage" 
    Dim currentNextPageView As RadPageView = myMultiPage.FindPageViewByID("MyNewPage")  
    If currentNextPageView IsNot Nothing Then  
        myMultiPage.PageViews.Remove(currentNextPageView)  
    End If  
    myMultiPage.PageViews.Add(pageView)  
     
    myTabStripmyTabStrip.SelectedIndex = myTabStrip.SelectedIndex + 1  
    myTabStrip.SelectedTab.Enabled = True 
    myMultiPagemyMultiPage.SelectedIndex = myMultiPage.SelectedIndex + 1 

    I now have:
    If currentNextPageView Is Nothing Then  
       myMultiPage.PageViews.Add(pageView)  
    End If  
     

    Now the page gets recreated only when it does not exists.
    Problem was probaly due to the fact that even when you remove the PageView, the related ScriptResources are not removed.

Back to Top