Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Server side event ServerMessage does not allow {}
posted

When trying to pass a Json string in ServerMessage as suggested in your documentation the server returns a 500 error.
Error message is

[FormatException: Input string was not in a correct format.]
System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args) +11773471
System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args) +61
Infragistics.Web.Mvc.UploadModule.OnBeginRequest(Object sender, EventArgs e) +1392
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

I guessed that you use String.Format internally and it's trying to parse the json object because that contains curly brackets. 
That does seem to be the case because I got it to work by manually escaping the brackets.
 
Version: IgniteUI 2016.2
This breaks:

public static void igUpload_UploadFinished(object sender, Infragistics.Web.Mvc.UploadFinishedEventArgs e){
   e.ServerMessage = "{}";
}


Adding this is a workaround:

e.ServerMessage.Replace("{", "{{");
e.ServerMessage.Replace("}", "}}");

  • 18124
    Offline posted

    Hello Robin,

    Thank you for posting in our forums!

    You are right about us using String.Format.  Thank you for bringing this to our attention.

    I have been able to reproduce this and I have created a support case for you with an ID of CAS-182426-S3N3Y2.  The matter has been determined to be a development issue and has been logged in our tracking system with ID: 234472.

    I will leave this case open and update you with any new information.  You can view the status of the development issue connected to this case by going to the “Account” tab on our website, selecting "My Support Activity" and then this support case will be listed there.  Then, you may select the "Development Issues" tab to view details of this development issue.

    Please let me know if you have any questions.