Display success popup message using jQuery Notify Plugin in ASP.Net MVC

Last Reply one month ago By dharmendr

Posted one month ago

Hi

How to display message using NotifyJs

In below code i want when record gets Added then Notification also should get displayed "Successfully Done"

public ActionResult Index()
{
    return View(dbLocation.GetAllLocation().ToList());
}
 
[HttpPost]
public ActionResult CreateEdit(Location objLocation )
{
    if (ModelState.IsValid)
    {
        dbLocation.Add(objLocation);
    }
 
    return RedirectToAction("Index");
}

 

$.notify(data.message, {
    globalposition: "top center",
    className: "success"
})

 

@using (Html.BeginForm("CreateEdit", "Location", FormMethod.Post))
{
    <input type="hidden" id="hfAU" name="hfAU" />
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    @*<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>*@
                    <h4 class="modal-title">Add New Location</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group row">
                        <label for="Id" class="col-sm-2 col-form-label">Id</label>
                        <div class="col-sm-10">
                            <input type="Text" class="form-control txt-style" id="txtId" Name="Id" placeholder="Location Id">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="IsActive" class="col-sm-2 col-form-label">IsActive</label>
                        <div class="form-check col-sm-10">
                            <input type="checkbox" class="form-check-input" value="true" id="IsActive" name="IsActive">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-primary">Save changes</button>
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
 
                    </div>
                </div>
            </div>
        </div>
    </div>
}

Thanks

This question does not have replies that have been liked.