I have a notification that looks like this:
<kendo-notification name="notifications" stacking="NotificationStackingSettings.Down" auto-hide-after="2500">
<position pinned="true" top="30" right="30" />
<popup-animation>
<open duration="700" />
<close duration="250" />
</popup-animation>
<templates>
<notification-template type="success" template='<p class="text-lead"><i class="fas fa-check-circle"></i> #=message#</p>'>
</notification-template>
<notification-template type="error" template='<p class="text-lead"><i class="fas fa-exclamation-circle"></i> #=message#</p>'>
</notification-template>
</templates>
</kendo-notification>
I want to avoid using unsafe-eval in the Content Security Policy. How do I convert the templates? The instructions given here are not clear in this case. I want to avoid using a client-side handler if possible.
Thank you
I need to show the notification on my razor page. The message comes from the controller. Below is what I have:
public ActionResult Index()
{
if (test == "Success")
return View("Successfully stored);
else
return View("failed to store");
}
On My razor page, I want to show the Success notification message when test is Success otherwise show the failure message. How can I achieve this. I don't want to click any button to show the success and failure notification.
Hello,
is it possible to play a sound / beep / whatever when showing a notification box?
I haven't found anything in the API for ASP.NET Core.
Thanks,
Christine
In a Grid, I try to edit a Product, that should have a unique Code.
In that case, I need the remote validation, to test, if the edited code would exist already in the database, different, from the edited product, of course.
For that, I need to send to the server the edited product Code, along with its Id.
In such cases, I would have an action like this, in the controller (documented here):
DTO:
[Remote(action: "VerifyCode", controller: "Products", AdditionalFields = nameof(ProductId))]
[Display(Name = "Product Code")]
public string Code { get; set; }
Controller:
[AcceptVerbs("GET", "POST")]
public IActionResult VerifyCode(string code, int id)
{
if (!_productService.VerifyCode(code, id))
{
return Json($"The code {code} is already taken by another product but shoud be unique, please change the code.");
}
return Json(true);
}
how to perform such validation when editing the Grid? Ideally inCell edit, but at least in Popup Mode....