Getting "Script control is not a registered script control" error
Description
Users utilizing Telerik UI for ASP.NET AJAX might encounter script control registration errors during development or runtime. These errors are typically presented as "Script control 'TelerikControlID' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors()." Such issues are prevalent in scenarios where asynchronous patterns, like using Async="true" in the page directive or employing asynchronous task methods in the code-behind, are applied alongside Telerik UI controls.
The core of these problems lies in the incompatibility or specific challenges of using the async-await pattern within WebForms that include Telerik UI for ASP.NET AJAX controls. While the async-await pattern is highly beneficial for creating responsive applications by performing non-blocking operations, its integration with certain UI controls requires careful handling to prevent runtime errors and ensure smooth operation.
Solution
-
Remove or disable async operations in the page directive and the code-behind. Specifically, set Async="false" in the page directive (if present) and convert asynchronous task methods back to synchronous methods where Telerik controls are involved. This change addresses the immediate issue by avoiding the async-await pattern that Telerik UI for ASP.NET AJAX controls struggle with. You can find more information here.
-
Ensure that the AJAX manager is not placed in a UserControl. You can find more information in this forum thread.
-
Check if the visibility of any control is changed at the wrong stage of the page life cycle. This can often cause the error. Refer to this Stack Overflow post for more information.
-
Temporarily disable AJAX and check for any hidden script errors using the instructions provided in this documentation.
-
If you are using the
asp:ScriptManager
, replace it with a TelerikRadScriptManager
. -
Disable the
RegisterWithScriptManager
property. Refer to this Stack Overflow post for more information. -
You can also try the steps provided in this forum thread for resolving a similar error.
-
Set the
Exportable
property tofalse
for all columns that should be excluded from the export and remove any lines in theItemCommand
event where their visibility is disabled.
If none of these solutions resolve the issue, isolate it in a simple runnable project and contact our support team for further assistance.