tags:

views:

74

answers:

1

Following the basic guildelines laid out in this blog (http://jake1164.blogspot.com/2010/06/jquery-fullcalendar-and-aspnet.html), i created an asp.net vb based web service that returns the following json data....however the calendar is not displaying any events. Any thoughts on what might be causing the issue ? thanks in advance.

<?xml version="1.0" encoding="utf-8"?><string xmlns="http://tempuri.org/"&gt;[{"id":1,"title":"Doctor D1","start":1279854594},{"id":2,"title":"Doctor D1","start":1279692000},{"id":3,"title":"Doctor D1","start":1279778400},{"id":4,"title":"Doctor D1","start":1280498809},{"id":5,"title":"Doctor D1","start":1280469600},{"id":6,"title":"Doctor D1","start":1280469600},{"id":7,"title":"Doctor D1","start":1280469600},{"id":8,"title":"Doctor D1","start":1280469600},{"id":9,"title":"Doctor D1","start":1280469600},{"id":10,"title":"Doctor D1","start":1280815200},{"id":11,"title":"Doctor D1","start":1280815200},{"id":12,"title":"Doctor D1","start":1280901600},{"id":13,"title":"Doctor D1","start":1281074400}]</string>
A: 

My guess is you didnt modify the fullcalendar script @ line ~421. the javascript eval function is required to convert the json into something fullcalendar can work with.

reportEventsAndPop = function(a) {

if (a.d) { var a = eval('(' + a.d.replace(/StartDate/g, 'start').replace(/EndDate/g, 'end') + ')'); }

reportEvents(a);
popLoading();

};

Jake1164
i will give that a try...however my json stream already has "start" in it. for example: {"id":2,"title":"Doctor D1","start":1279692000} is one of the objects. (i named my property "start" in my CalendarDTO object. I was wondering if it's the way the json data is wrapped in the xml tag. (see my post above). thanks for your time
I recommend downloding the example and seeing how its done.. there are several changes that are required to get the plugin working in vb.net.
Jake1164
I'm getting closer now, having copied your code sample pretty much exactly...Only difference i'm now finding is the json sent back to the calendar from my app versus you sample app...your json starts with a little fragment as follows: {"d":" My json starts without that little fragment. I'm using the same exact .js files as in your code sample. Is there some setting in the web.config that might be impacting the way the json gets wrapped up/serialized...I'm not certain that's issue, but my events are not displaying on the calendar and that's the only difference i can see. thanks.
You might need to add something under the <webServices><protocols> section of the web config. You probably need to either add or uncomment the <add name="HttpPost"/> or <add name="HttpGet"/>. This seems to be more a .net 1.1 fix though. http://msdn.microsoft.com/en-us/library/b2c0ew36(VS.71).aspx
Jake1164
turned out to be my targeting .net 2.0 framework. Retargeted to 3.5 and included the System.Web.Extensions dll reference and all seems fine.. I guess it's a slight difference in the behavior of json serialization. Thx for your assistance.