You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>It's pretty common in web apps that need to have a notification after user's action.</p><p>Below is the option I apply into my asp.net mvc website: toastr</p><p>1/ Download css & js files</p><p>Go to the <a href="https://cdnjs.com/libraries/toastr.js" target="_blank">cdn website</a> and take latest files into Content / Scripts folder (for debugging)</p><p>2/ Adding new bundles (css & javascript)</p><blockquote>bundles.Add(new ScriptBundle("~/bundles/toastr", "//cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.js")<br> .Include("~/Scripts/toastr.min.js"));<br> bundles.Add(new StyleBundle("~/Content/toastr", "//cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.css")<br> .Include("~/Scripts/toastr.min.css"));</blockquote><p>3/ Render the bundles into expected view</p><blockquote> @Scripts.Render("~/bundles/toastr")<br> @Styles.Render("~/Content/toastr")</blockquote><div>4/ And use it as below</div><blockquote>toastr.options.positionClass = 'toast-top-center';<br>if (response.Result) {<br><span style="white-space:pre"> </span>toastr.success(response.Message);<br>} else {<br><span style="white-space:pre"> </span>toastr.error(response.Message);<br>}</blockquote><p><b>References:</b><br></p><ul><li><a href="https://github.com/CodeSeven/toastr" target="_blank">toastr github</a><br></li></ul>