asp.net - Convert a webmethod from c# to vb.net -



asp.net - Convert a webmethod from c# to vb.net -

i did web method below using c#. i'm tryin convert vb.net, i'm missing something. i'm using ajax calling, paginator/sorter table plugin.

[webmethod( enablesession = true )] public static object listapessoas(int jtstartindex = 0, int jtpagesize = 0, string jtsorting = null) { homecoming new { result = "ok", records = persons.tolist(), totalrecordcount = persons.count }; }

first, error in vb - can't leave parameters optional("attribute webmethod cannot applied method optional parameters"):

<webmethod()> _ public function listapessoas(optional byval jtstartindex integer = 0, optional byval jtpagesize integer = 0, optional byval jtsorting string = nothing)

second, don't know how homecoming message "ok" , list of people.

can me help convert vb.net?

seems can't utilize optional parameters webmethods. can utilize overloading. example:

<webmethod()> _ public function listapessoas(jtstartindex integer, jtpagesize integer) <webmethod()> _ public function listapessoas(jtstartindex integer, jtpagesize integer, jtsorting string)

the c# object returned anonymous object. vb syntax is:

return new { .result = "ok", .records = persons.tolist(), .totalrecordcount = persons.count }

asp.net vb.net

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -