Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys,

I have fullCalendar control on my asp.net page.

and I have dates values stored in SQL SERVER DataBase.

For this I wrote stored procedure to get values.

Now, I want to fill these values(dates) in the FullCalendar...

What I have tried:

which method I have to use to fill dates in fullcalendar?

events: {
        url: '/myfeed.aspx',
        type: 'POST',
        data: {
            custom_param1: 'something',
            custom_param2: 'somethingelse'
        },
        error: function() {
            alert('there was an error while fetching events!');
        },
        color: 'yellow',  
        textColor: 'black' 
    }


Can any one please help me?


thanks
Posted
Updated 6-Sep-16 22:41pm
v2
Comments
Karthik_Mahalingam 5-Sep-16 8:21am    
refer the Api doc and code accordingly
https://fullcalendar.io/docs/

1 solution

C# code:
C#
public object SessionScheduleDates
{
    get
    {
        string output="";
        if (Session != null)
        {
            string input = Session.ScheduleDates;
            output = "[" + "\"" + input.Replace(",", "\",\"") + "\"" + "]";
        }
        return output;
    }
}


JavaScript
<script>
    var ScheduleDates = new Array();
    ScheduleDates = <%= SessionScheduleDates %>;
    for (var i = 0; i < ScheduleDates.length; i++) {
        //alert(ScheduleDates[i]);
        $("#calendar").fullCalendar('addEventSource', [{
            start: ScheduleDates[i],
            rendering: 'background',
            block: true,
        }, ]);
    }
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900