This is a migrated thread and some comments may be shown as answers.

url for Listview

5 Answers 122 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Kushal
Top achievements
Rank 1
Kushal asked on 07 Sep 2012, 10:26 AM
i am using kendo listview in which i am specifying url as below

$("#btnShowRestaurant").click(function () {
                alert('hiii');


                var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "Restaurant.aspx/GetHotelData",
                            dataType: "jsonp"
                        }
                    },
                    pageSize: 12
                });

Is it they right way? because the webmethod in codebedhind is unreachable... any body having similar issue..any other option..

thanks in advance
             
             

5 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 07 Sep 2012, 11:12 AM
Not sure about it, things needed for it to work:
  • Your function must be public
  • Your function must be static
  • You have to set the WebMethod attribute to the function with EnableSession = false
0
Kushal
Top achievements
Rank 1
answered on 07 Sep 2012, 11:15 AM
at least someone replied...let me check...
0
Kushal
Top achievements
Rank 1
answered on 07 Sep 2012, 12:54 PM
checked...still not working 

WebMethod attribute  EnableSession = false was missing added that as well but doesn't help..

any thing else...

0
Nohinn
Top achievements
Rank 1
answered on 07 Sep 2012, 02:01 PM
Still not working means the control is not populating or you're not receiving anything from the call?

To be sure of this question you can look with firebug or chrome developer tools at the network tab, if you're getting there anything from that url "Restaurant.aspx/GetHotelData", could you take an screenshot so I (or anyone else) can take a look at it?

Maybe you're receiving it but not as it is expected, or maybe you're having a 500 error or similar, so an screen would be handful.
0
Kushal
Top achievements
Rank 1
answered on 08 Sep 2012, 08:51 AM
@Nohinn  ..  i really appreciate you helping me out...

My first question is.. the code i am using [ url: "Restaurant.aspx/GetHotelData", ]
is it correct...  because i have break point on GetHotelData function, but control never reaches there... 

Do you have any example where a code behind function is called in kendo ui list veiw url.

there is one more question.. i see many examples url like this " url: "/Person/SearchRolResults", "  .. they are calling web services right??

** I have attached the file but ignore it .. it shows only headers..!!


Tags
ListView
Asked by
Kushal
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
Kushal
Top achievements
Rank 1
Share this question
or