Dynamic dynamically change the class and dynamically_layout of the css label of the master _ Layout page body
This function is a function recently implemented by Insus. NET. It is a class that dynamically changes the style css of the master _ Layout page body tag in dynamically.
Many views share a master _ Layout page, but the style of a view body may be different.
Therefore, the value of the class must be changed dynamically.
See the style before modification:
Can I see the red arrow? We need to modify the value of this class dynamically.
OK. Let's add some code:
Simply put, the following Insus. NET views two views respectively, and then we can see how the generated results are:
The following is a non-Index View:
So far, we can determine that the code can be run, because the Index and non-Index views can dynamically change the value of the body Tag.
In the Razor syntax, it is easy to write, directly @... or @{...}