Listview databinding

1 posts, 0 answers
  1. Roger
    Roger avatar
    183 posts
    Member since:
    Sep 2007

    Posted 16 Mar 2012 Link to this post

    am trying to provide json databinding functionality to using your grid-page-methods-crud demo but it's not working.
    The list is:
    <ul id="Appointment_listview"></ul>

    the script is:
    <script type="text/javascript">
        var listData = new{
                    transport: {
                        read: {
                            url: "Service.asmx/GetAppointment",
                            dataType: "jsonp",
                            data: { //additional parameters sent to the remote service
                                q: "javascript"
                    schema: { // describe the result format
                        data: "results" // the data which the data source will be bound to is in the "results" field
        function mobileListViewDataBindInitFlat() {
                template: "<a href='details.aspx?id=${}'>${data.subject}</a>",
                dataSource: listData

    and the web service is
    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports System.ComponentModel
    ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    ' <System.Web.Script.Services.ScriptService()> _
    <System.Web.Services.WebService(Namespace:="")> _
    <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
    <ToolboxItem(False)> _
    Public Class Service
        Inherits System.Web.Services.WebService
        <WebMethod()> _
        Public Shared Function GetAppointment() As IEnumerable(Of AppointmentSummary)
            Dim dt As DataTable = DataManager.Appointments_Get(SessionManager.AppID, SessionManager.UserID, Date.Now)
            Dim var As New List(Of AppointmentSummary)
            For Each dr As DataRow In dt.Rows
                Dim apt As New AppointmentSummary
                With apt
                    .id = dr("id").ToString
                    .subject = dr("Subject").ToString & " (" & CDate(dr("Start")).ToShortDateString & " " & CDate(dr("Start")).ToShortTimeString & ")"
                End With
            Return var.ToList
        End Function
    End Class

    of course I finish off the script with:
    <script type="text/javascript">
        var app = new;

    the page loads with the header & viewing the console I get this error
    GET http://localhost:56634/main/Service.asmx/GetAppointment?callback=jQuery17106404353028628975_1331880114840&q=javascript&_=1331880115408 500 (Internal Server Error)

    When I had the web service on the maindefault page I was getting javascript errors thta it couldn't find kendo object ?????

    Any suggestions?

Back to Top