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....