Enterprise Platform Project Learning Summary 2-Experiences

Source: Internet
Author: User

Action in Controller:

When using ActionResult, to display the page, the code snippet can right-click to the HTML;

When using Jsonresult, for a function method in the page, the right button cannot jump;

These two descriptions are useful at least because they sometimes participate in int, and so on.

Related code for interface and interface implementations:

Access modifiers:

When the implementation code in IMPL needs return true/false, the access modifier is bool type;

New Parameter settings:

When you need to add a parameter, use string, long or int, and so on;

Use the class name when you need to add more than one parameter at a time;

The controller does not get the actual parameters, the actual parameters are defined in the script.

The implementation of the method can also be described in the controller.

Absolute address URL: usually refers to www.baidu.com and other URLs.

Relative address URL: usually refers to internal files, such as JS files in the Scripts folder.

Checked= "Whatever will be selected", here checked is attribute,html as long as there is checked will be selected.

JS Control the selected checked is not attribute (string), but the properties (bool).

. attr ("checked", false) is still selected, prop ("checked", false) OK.

The values of all input controls are sent along with the request, and may receive multiple values at the same time, to differentiate, append a key to each value, that is, the Name property.

The Name property is used internally by Html and is called when the request is sent, but the ID attribute is implemented in JavaScript for dynamic functionality.

C # about the implementation of the method as a logical layer

There are two types of search: 1 to find or not, true/false, with bool type;

2 to find and display, complex for generics, forms, single long type, form;

Added: 1 for increase or not, true/false, with bool type;

2 increase the success or not of different situations, 1/2/3, with the int type

Modify Ibid.

Delete ditto

In MVC C, you use the interface method in the service:

First, add the interface part of the service project;

Second, the service running code Client is pasted into the App_start;

Finally, it is statically instantiated in Global.asax.cs.

foreach traversal

can be used for string, string[], long[];

However, the long type does not contain a public definition of getenumberator and is not available.

Methods in the Controller embedded service method parameter number must be consistent parameter name can vary the specific situation also have different

interface method, get database data in two ways:

1.public pageinfo<classinfo> GetInfo (int pageIndex, int pageSize)

return new pageinfo<classinfo> (data. Total, LST);

2.public list<classinfo> GetInfo ()

return LST;

To get data for a table in a database, be sure to use a method call, which is analyzed as follows:

A table in a database is equivalent to a class in a service that cannot be read directly and requires a method implementation.

Enterprise Platform Project Learning Summary 2-Experiences

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.