Dynamic dynamically change the class and dynamically_layout of the css label of the master _ Layout page body

Source: Internet
Author: User

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 @{...}

 

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.