Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script path is hardcoded and ignores ScriptSrc #162

Open
CumpsD opened this issue Dec 7, 2022 · 0 comments
Open

Script path is hardcoded and ignores ScriptSrc #162

CumpsD opened this issue Dec 7, 2022 · 0 comments

Comments

@CumpsD
Copy link

CumpsD commented Dec 7, 2022

https://github.com/nabinked/NToastNotify/blob/master/src/Views/Shared/Components/NToastNotify/Default.cshtml#L7 uses https://github.com/nabinked/NToastNotify/blob/master/src/Components/NToastNotifyViewComponent.cs#L30 to load the script

The ScriptSrc property is in https://github.com/nabinked/NToastNotify/blob/master/src/Components/NToastNotifyViewComponent.cs#L28

The rendered html shows the mismatch:

<script src=[/_content/NToastNotify/toastr.js?8.0.0.0](https://dev-landing.exira.com:7443/_content/NToastNotify/toastr.js?8.0.0.0)></script><script>if(nToastNotify){nToastNotify.init({firstLoadEvent:'DOMContentLoaded',messages:[],responseHeaderKey:'X-NToastNotify-Messages',requestHeaderKey:'X-Requested-With',libraryDetails:{"varName":"toastr","scriptSrc":"/lib/toastr/toastr.min.js","styleHref":"/lib/toastr/toastr.min.css","options":{"positionClass":"toast-bottom-center","progressBar":false,"type":"success"}},disableAjaxToasts:false});};</script>

The C# used to load:

                .AddNToastNotifyToastr(
                    new ToastrOptions
                    {
                        ProgressBar = false,
                        PositionClass = ToastPositions.BottomCenter,
                    },
                    new NToastNotifyOption
                    {
                        ScriptSrc = "/lib/toastr/toastr.min.js",
                        StyleHref = "/lib/toastr/toastr.min.css",
                    })

This results in GET ......................./_content/NToastNotify/toastr.js net::ERR_ABORTED 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant