Search results

Add custom indication to unsaved value in ASP.NET MVC In-place Editor control

26 Oct 2021 / 1 minute to read

You can add custom indication to unsaved input value by using the ActionSuccess event, when data not submitted to the server.

In this sample, the ActionSuccess event configured and the Url property not included. Then submit button clicked, the current editor value saved into input and data sending to server action prevented due to the Url property not configured.

But ActionSuccess event will trigger the handler function with null argument values. In handler function data property PrimaryKey value checked, whether it empty or not. If it is empty custom class, added in the e-value-wrapper element to customize its styles.

To send input value to local, set the Url property as empty.

Copied to clipboard
@using Syncfusion.EJ2.InPlaceEditor;

<div id='container'>
    <span class="content-title"> Enter your name: </span>
    <div id='element'></div>

    #container {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 80px;

    #element {
        width: 150px;

    .content-title {
        font-weight: 500;
        margin-right: 20px;
        display: flex;
        align-items: center;

    .e-inplaceeditor .e-editable-value-wrapper .e-editable-value.e-send-error {
        color: red;
    function actionSuccess(e) {
        var editObj = document.getElementById('element').ej2_instances[0];
        var pk =['PrimaryKey'];
        if (ej.base.isNullOrUndefined(pk) || pk === '') {
Copied to clipboard
public class HomeController : Controller
    public ActionResult Index()
        ViewBag.model = new { placeholder = "Enter some text" };
        ViewBag.value = "Andrew";
        return View();

The output will be as follows.