Open Closed

Using a custom javascript file in an override of My Account > Change Password #6350


User avatar
0
balessi75 created

ABP Commercial 7.4.2 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme

Hi, We have successfully overridden the Change Password UI (see solution structure below). The problem is that we need to reference a new javascript file in the overridden page to augment it's functionality.

In Pages/Account/Components/ProfileManagementGroup/Password/Default.cshtml, we attempted to add the following and at runtime but the page never includes the javascript reference.

This didn't work:

@section scripts
{
   <script type="text/javascript" src="/Pages/Account/PasswordStrength.js"></script>

}

and this didn't work

@section scripts
{
    <abp-script-bundle name="@typeof(ManageModel).FullName">
        <abp-script src="/Pages/Account/PasswordStrength.js" />
    </abp-script-bundle>

 }

Is there something different that needs to be done with these view components (password, personalinfo, profilepicture, etc)?


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Replace the js file from typeof(ManageModel).FullName

    Configure<AbpBundlingOptions>(options =>
    {
        options.ScriptBundles
            .Configure(typeof(ManageModel).FullName,
                configuration =>
                {
                    configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/Password/Default.js");
                    
                });
    });
    
    
  • User Avatar
    0
    balessi75 created

    Excellent, this was very helpful. Thanks @maliming!

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35