Apostrophe In Description

Hi,

I’m having an issue when someone saves an event and enters an ’ into the description text it does not allow someone to save the event again without removing it (after the page gets refreshed).

Here’s how to replicate the issue:

  1. Add an event to the calendar with the description Test’s Event
  2. Reload the calendar
  3. You will notice the title (before opening the lightbox) that it is still titled Test’s Event
  4. Once you open the lightbox, the title will be Test's Event.

In order to resave the event I’d have to remove the ’ and put the ’ in again or remove the ’ altogether.

I’ve done some troubleshooting already and this is what I came up with:

  1. The description text in the database is: Test’s Event
  2. When the information comes into the xml data object as @myevent.text where @myevent is the CalendarActionResponseModel it is still: Test’s Event
  3. It shows as Test’s Event (before you open the lightbox window)
  4. It fails when it comes into the description textbox when opening the lightbox window.

Any help would be appreciated.

Thanks!

Hello,
How do you render the response data? Most likely the Razor engine escapes values that are considered as unsafe(html tags, some special characters such as quotes used in js)
Here is related question on stackowerflow
stackoverflow.com/questions/5225 … apostrophe

As a solution, you can render text using @Html.Raw helper

Using the @Html.Raw helper worked for me.

Thanks!