Implementation of the. NET online development path based on CKEditor (2) write C # code, how to invoke it.

Source: Internet
Author: User
Tags call back

The previous chapter of the simple introduction of the CKEditor Editor, you can edit the JS logic code, css,html,c# code, this chapter I based on practical examples, how to write C # code and how to call it.

Everyone remembers just touching the programming when the Hello Word bar, first I introduced in the editor wrote back "Hello word" C # method, let how to call back the corresponding Hello Wrod method, the specific code is as follows:

Run the preview effect as

After the page loads, the Hello World dialog box pops up. The proof gets to us to write the return string.

Note that C # code is edited and can be called with Ajax, and C # code methods must have some rules

The first method is that the public method passed in the parameter is fixed string Parameter, Hashtable querystring These two, the method name can be arbitrarily changed. The return is a JSON string.

   public string method name (string Parameter, Hashtable QueryString)      {                    return   PLATFORM.KYLIN.JSONHELPER.JSONMSG ( True, "Hello world! ");      }

Parameter description: QueryString: Is a Hashtable object, this object stores the URL passed in the parameter.

Parameter: is a JSON string that is passed on the page and is the parameter object in the following JS calling code.

When called

Common.ajax (). Actionpost ("Method name", Parameter object, function (JSON) {                       alert (json.mess);///json is the returned JSON object         });

Other specific functions need to be explored on their own.

In order to facilitate everyone on the C # code, HTML,JS,CSS written, I nested a codemirror JS highlighting, automatic formatting, there are a small hint plugin, the location of the plug-in:

Red box position, click the Code edit button pops up like:

Realize other functions need everyone to experience, to try, spit groove place Welcome to spit groove, if you are interested, welcome to join Group qq:109434403

Experience website address: http://www.zjt-lab.com/Platform/; user name: admin Password: 0

Implementation of the. NET online development path based on CKEditor (2) write C # code, how to invoke it.

Related Article

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.