ASP. Joyrock Asynchronous Application example, Json-rpc use method

Source: Internet
Author: User

Using Joyrock requires referencing the Jayrock.dll,jayrock.json.dll two file, plus the introduction of json.js files in the Web page (json.js not available in the same place),

. NET Background files

Using system;using system.collections.generic;using system.linq;using system.web;using Jayrock.Json;using Jayrock.jsonrpc;using jayrock.jsonrpc.web;namespace exam.jayrock{public class Handler1:jsonrpchandler {// /<summary>//without parameters///</summary>//<returns></returns> [JSONRPCME Thod ("Getstring1")] public string getstring1 () {return String.Format ("Welcome-Jayrock by {0}!        ", DateTime.Now); }///<summary>//with parameters///</summary>//<param name= "str" >the string.< /param>//<returns></returns> [Jsonrpcmethod ("Getstring2")] public string getstring2        (String str)        {return String.Format ("Welcome to Jayrock by {0}!", str); } [Jsonrpcmethod ("addentity")] public int addentity (Jsonobject ent) {New Entity ("Demo"). A            Ddentity (ENT);     return 1;   } [Jsonrpcmethod ("updateentity")] public int updateentity (Jsonobject ent) {new Entity            ("Demo"). updateentity (ENT);        return 1; } [Jsonrpcmethod ("delentity")] public int delentity (int id) {New Entity ("Demo"). delentity            (ID);        return 1;            } [Jsonrpcmethod ("Getentitylist")] public list<jsonobject> getentitylist (string where) {        return new Entity ("Demo"). Getentitylist (where); }    }}

Foreground call page



ASP. Joyrock Asynchronous Application example, Json-rpc use method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.