I am using fullcalendar plugin -
//c#
public JsonResult Events(int start, int end) // GetEvents return an array of my DTO
{
return Json(GetEvents(ConvertFromUnixTimestamp(start), ConvertFromUnixTimestamp(end)), JsonRequestBehavior.AllowGet);
}
//html
<head>
<script type='text/javascript'>
$(document).ready(function () {
$('#calendar').fullCalendar({
header: {
left: '',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
month: 5,
year: 2011,
editable: false,
events: 'MyWebsite/Events'
});
});
</script>
The problem is the data is getting encoded, so I want to pass something like "<b>Name</b>"
it gets encoded. So, I tried serializing with AllowHtml attribute but does not work also I have tried bunch of other things. What I need to do is somehow call serialize object without the encoding which I guess by default..or at least skip encoding for the one field with AllowHtml
data annotation ? I have a looked at a similar problem.
Can anyone give me any help here I cannot really use Html.Raw() as I see it since I am passing the data to javascript I guess it just needs to be somehow decoded.