Tips on developing ASP-let the value of the pass-through object

Source: Internet
Author: User

Front end: The front end defines an object that is serialized as a JSON string when an instance of the object is passed as a value

The code is as follows:

To define a JS object:

      Defines a query condition object var searchcondition=function () {this        . code=$ ("#Code"). Val ();        This. projectid=$ ("#Project"). Val ();        This. customerid=$ ("#Customer"). Val ();       };
Serialization of

$ ("#search"). Click (function () {
var sc = new searchcondition ();
$ (' #projectlist '). DataGrid (' Load ', {
V_cusproject:JSON.stringify (SC),
Type: "Getprojectlist"
});

});

Background: Accepts JSON strings, then deserializes them into objects or key-value pairs

The code is as follows:

   String Vpmodel = GETPARAM.F ("V_cusproject");        Model.v_cusproject VP = jsonhelp.jsontoobject<model.v_cusproject> (Vpmodel);

This allows the entity to be made easy to do the following

Or become a key-value pair:

        String conditons = GETPARAM.F ("conditons");         dictionary<string, object> dic = Jsonhelp.datarowfromjson (conditons);

  

Glance

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.