title: Why I am Getting Error Message from WebPage "Undefined"
body: <p>For Displaying Message I have AddedOnEndCallback() function which is working Fine As expected But while clicking New Button or Cancel Button its showing Error Message Like Undefined I check every Where I mean On network Tab as well as in Console Windows but no any error i found where i am doing Mistake Please Suggest me:</p>
  <p>Edit:</p>
  <p>I have added:</p>
  <pre><code>if (gvc.cpInsertNote == undefined ) {
                  // Ignore
              }
  </code></pre>
  <p>So for now Undefined Message is not Appearing First Time But Later always showing same message for every Click Please Suggest me where i am doing Wrong ?</p>
  <p>ASPX:</p>
  <p>Grid View :</p>
  <pre><code> &lt;Templates&gt;
     &lt;DetailRow&gt;
       &lt;dx:ASPxGridView ID=&quot;dgCustomers&quot; runat=&quot;server&quot; KeyFieldName=&quot;CustomerLineItemID&quot; OnBeforePerformDataSelect=&quot;dgCustomers_BeforePerformDataSelect&quot;
          OnDataBinding=&quot;dgCustomers_DataBinding&quot; ClientInstanceName=&quot;gvc&quot;
          Width=&quot;100%&quot; OnRowDeleting=&quot;dgCustomers_RowDeleting&quot; OnRowInserting=&quot;dgCustomers_RowInserting&quot;
          OnRowUpdating=&quot;dgCustomers_RowUpdating&quot; CellStyle-HorizontalAlign=&quot;Center&quot;&gt;
         &lt;ClientSideEvents EndCallback=&quot;OnEndCallback&quot; /&gt;
             &lt;Columns&gt;
                .......
                  .......
  </code></pre>
  <p>Js.</p>
  <pre><code> function OnEndCallback() {
          if (gvc.cpInsertNote == undefined || gvc.IsNewItemEditing() ||gvc.IsEditing()) {
              // Egnore
          }
  
          else {
              if (gvc.cpInsertNote != &quot;&quot;) {
                  alert(gvc.cpInsertNote);
              }
          }
          //return;
      }
  </code></pre>
  <p>.Cs</p>
  <pre><code>  if (CustomerCount &gt; 0)
          {
              ((ASPxGridView)sender).JSProperties[&quot;cpInsertNote&quot;] = &quot;Duplicate Entries Not Allowed&quot;;
              e.Cancel = true;
              return;
          }
  </code></pre>
  <p>I am ABle to display Message But while clicking New Button of grid View its showing &quot;Undefined&quot;  why ?</p>
  <p><a href="https://i.stack.imgur.com/abMA7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/abMA7.png" alt="enter image description here" /></a></p>