19: MVC Strong Type declaration

Source: Internet
Author: User

After a few sections, I am very lazy, I have to find a time to make up ...

1. Strong type

Refers to a variable whose type is explicitly specified when it is defined. Such as:

string S;

int x;

2. Weak type

The type is determined only when the value is assigned.

var s;

var x;

Dynamic type

ViewBag;

personally think : The advantage of using a strong type is that you can point out the fields inside, without needing you to go to the database to view, or write a typo paragraph

Below I create a project

Here, I'm not connected to the database test (a little trouble, the principle is OK) Create class Save

and call it out.

I'm not using viewbag here.

But it's like he's making a mistake.

。。。 Hit the face.

Must be to include

... I don't really have a good idea.

Help!!!

Create a class, how to use a strongly typed

Always said not to contain getnumerator

Anyway

It's settled.

You can also show the values in the class.

19: MVC Strong Type declaration

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.