[CLOSED] htmlEditor error when saving or adding data on OnBeforeStoreChanged, (500) internal communication error

  1. #1

    [CLOSED] htmlEditor error when saving or adding data on OnBeforeStoreChanged, (500) internal communication error

    When saving and adding data using the OnBeforeStoreChanged event, it succeeds and the event fires when the htmlEditor contains one line of text, But when I go to a new line in the htmlEditor and click Save or Create, the OnBeforeStoreChanged event doesn't fire and a (500) internal communication error is returned from inside the funcions grid.store.insert() or form.getForm().updateRecord() aspx page code:
          Mail Template
    Code Behind C#
             ///          /// Insert MailTemplate         ///          /// 
             ///          private int AddMailTemplate(MailTemplate aps)         {             try             {                 lock (lockObj)                 {                     aps = MailTemplateBLL.Insert(aps);                     return aps.MailTemplateId;                 }             }             catch (Exception ex)             {                 new CustomException(ex, ErrorType.Base);                 throw ex;             }         }          ///          /// Delete MailTemplate         ///          /// 
             private void DeleteMailTemplate(int MailTemplateId)         {             try             {                 lock (lockObj)                 {                     MailTemplate aps = null;                     aps = MailTemplateBLL.Get(MailTemplateId);                      if (aps == null)                     {                         throw new Exception("MailTemplate not found, in ManageMailTemplate.aspx in DeleteMailTemplate");                     }                     if (aps.MailTemplateId == MailTemplateId)                         MailTemplateBLL.Delete(MailTemplateId);                 }             }             catch (Exception ex)             {                 new CustomException(ex, ErrorType.Base);                 throw ex;             }         }          ///          /// Update MailTemplate         ///          /// 
             private void UpdateMailTemplate(MailTemplate aps)         {             try             {                 lock (lockObj)                 {                     MailTemplate updatingAps = null;                     updatingAps = MailTemplateBLL.Get(aps.MailTemplateId);                      if (updatingAps == null)                     {                         throw new Exception("MailTemplate not found, in ManageMailTemplate.aspx in UpdateMailTemplate");                     }                     if (updatingAps.MailTemplateId == aps.MailTemplateId)                     {                         updatingAps.Name = aps.Name;                         updatingAps.FromAddress = aps.FromAddress;                         updatingAps.Subject = aps.Subject;                         updatingAps.Body = aps.Body;                         updatingAps.Enabled = aps.Enabled;                     }                     else                         throw new Exception("MailTemplate not found, in ManageMailTemplate.aspx in UpdateMailTemplate");                     MailTemplateBLL.Update(updatingAps);                 }             }             catch (Exception ex)             {                 new CustomException(ex, ErrorType.Base);                 throw ex;             }         }          ///          /// Update Store when Adding, Deleting and Updating a record         ///          /// 
             /// 
             protected void HandleChanges(object sender, BeforeStoreChangedEventArgs e)         {             try             {                 List listAps = e.DataHandler.ObjectData();                  if (e.Action == StoreAction.Create)                 {                     foreach (MailTemplate created in listAps)                     {                         this.AddMailTemplate(created);                         e.ResponseRecords.Add(created);                     }                 }                  if (e.Action == StoreAction.Destroy)                 {                     foreach (MailTemplate deleted in listAps)                     {                         this.DeleteMailTemplate(deleted.MailTemplateId);                         //e.ResponseRecords.Add(new {});                     }                 }                  if (e.Action == StoreAction.Update)                 {                     foreach (MailTemplate updated in listAps)                     {                         this.UpdateMailTemplate(updated);                         e.ResponseRecords.Add(updated);                     }                 }                 e.Cancel = true;             }             catch (Exception ex)             {                 new CustomException(ex, ErrorType.Base);                 throw ex;             }         }
    Last edited by Daniil; Sep 23, 2014 at 10:07 AM. Reason: [CLOSED]
  2. #2
    Hi @DenisEdde,

    Unfortunately, the test case throws a Compilation Error when I try to run it.
    CS0246:  The type or namespace name 'MailTemplate' could not be found (are you  missing a using directive or an assembly reference?)
    Please provide a runnable and a standalone test case. Please see Example (Very Helpful) here:
    Forum Guidelines For Posting New Topics

Similar Threads

  1. Replies: 0
    Last Post: Sep 06, 2014, 5:51 PM
  2. Replies: 1
    Last Post: Jan 30, 2014, 6:09 AM
  3. Internal Server Error 500
    By Ganesh3.shirsath in forum 1.x Help
    Replies: 2
    Last Post: Feb 07, 2013, 9:37 AM
  4. Request failure : Internal Server Error
    By richard in forum 2.x Help
    Replies: 1
    Last Post: Mar 15, 2012, 12:16 PM
  5. Internal Server Error 500
    By Ganesh3.shirsath in forum 1.x Help
    Replies: 3
    Last Post: Jan 20, 2011, 2:07 PM

Posting Permissions