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
Post a Comment