Skip to content

Fix CRM during Partial Postback (UpdatePanel) #6933#6935

Merged
valadas merged 3 commits intodnnsoftware:developfrom
thienvc:develop
Jan 27, 2026
Merged

Fix CRM during Partial Postback (UpdatePanel) #6933#6935
valadas merged 3 commits intodnnsoftware:developfrom
thienvc:develop

Conversation

@thienvc
Copy link
Copy Markdown
Contributor

@thienvc thienvc commented Jan 26, 2026

Summary

Fixes #6933

DnnResources fails to inject JS/CSS assets during Partial Postback (UpdatePanel)

Description: It appears that the logic for injecting Client Resources (JS/CSS) during an Asynchronous Postback (Partial Rendering) was overlooked or lost during previous refactoring of the Client Dependency Framework (CDF).

As a result, controls that are dynamically loaded or become visible only after a partial postback (inside an UpdatePanel) fail to initialize because their required scripts are not registered in the browser.

Steps to Reproduce:

  1. Navigate to Module Settings of an HTML Module.
  2. Go to the Page Settings tab -> Basic Settings.
  3. In the "Icon" section, change the dropdown to "File (A File On Your Site)".
  4. Observe the Browser Console.

Actual Result: The DnnDropDownList control fails to render, and console errors appear (e.g., dnn.createDropDownList is not a function) because the necessary JS files were not loaded.

Expected Result: The ScriptManager should receive the required script tags via RegisterDataItem, allowing the control to initialize correctly.

Fix: Restore missing Client Resource injection logic in DnnResources during Async Postback

Description:
What does this PR do? This PR restores the logic responsible for handling ScriptManager.RegisterDataItem within the DnnResources control. This logic ensures that JavaScript and CSS resources are correctly sent to the client during a Partial Postback (AJAX), which is critical for WebForms controls running inside an UpdatePanel.

Root Cause: Previously, the mechanism to inject resources (using keys like $crm_BodySCRIPTS) existed in ClientResourceLoader but was seemingly lost or not fully ported to DnnResources during recent CDF updates. This caused a regression where controls becoming visible after a postback (e.g., DnnDropDownList in Module Settings) rendered their HTML but lacked their dependency scripts.

Changes:

Modified DnnResources.cs to check if ScriptManager.IsInAsyncPostBack is true.

Restored the logic to package pending JS/CSS resources and register them via ScriptManager.RegisterDataItem, allowing the client-side PageRequestManager to inject them into the DOM.

Verification / Testing:

Open any module using UpdatePanel where a control requires a script resource (e.g., HTML Module Settings -> Page Settings).

Trigger a partial postback that reveals a DnnDropDownList or similar control.

Success: The control renders correctly, and no "undefined function" errors appear in the console.

…Panel) dnnsoftware#6933

This PR restores the logic responsible for handling ScriptManager.RegisterDataItem within the DnnResources control. This logic ensures that JavaScript and CSS resources are correctly sent to the client during a Partial Postback (AJAX), which is critical for WebForms controls running inside an UpdatePanel.
Fix CRM fails to inject JS/CSS assets during Partial Postback dnnsoftware#6933
Copy link
Copy Markdown
Contributor

@mitchelsellers mitchelsellers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

@bdukes bdukes added this to the 10.2.2 milestone Jan 26, 2026
@valadas valadas merged commit 56f1052 into dnnsoftware:develop Jan 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client Resource Loader - JS Helpers for AJAX Missing

4 participants