views:

258

answers:

1

I am trying to figure out this fullcalendar and how to get events from database. I am using asp .net

I am using a webservice that has something like this. I am just trying to put a test record first then I will tie it to the database once i get it working.

Any help would be greatly appreciated! Thanks alot! Just trying to figure out how to tie my webservice.

So my webservice goes like so.

_ _ _ _ Public Class WebService1 Inherits System.Web.Services.WebService

<WebMethod()> _
 <ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True)> _
Public Function Getcalendar() As String

    Dim sb As New StringBuilder
    Dim sw As New IO.StringWriter(sb)
    Dim strOut As String = String.Empty

    Using writer As New JsonTextWriter(sw)
        writer.WriteStartObject()
        writer.WritePropertyName("id")
        writer.WriteValue("999")
        writer.WritePropertyName("title")
        writer.WriteValue("my test")
        writer.WritePropertyName("allday")
        writer.WriteValue("false")
        writer.WritePropertyName("start")
        writer.WriteValue("2010-04-14T11:00:00")
        writer.WritePropertyName("end")
        writer.WriteValue("2010-04-14T13:00:00")
        writer.WriteEndObject()
        strOut = sw.ToString
    End Using

    Return strOut


End Function

End Class

And my html goes like this

<script type="text/javascript">
$(document).ready(function() {            
$('#calendar').fullCalendar({
   header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },

    editable: true,
    events: RVCSC.WebService1.Getcalendar() 
});

});

A: 

I think you can find the solution to using fullcalendar with VB.NET and SQL here: http://jake1164.blogspot.com/2010/06/jquery-fullcalendar-and-aspnet.html

Jake