liveBook · Manning

Asp-fallback-test-value

As explained in Pro ASP.NET Core 7, Tenth Edition

The asp-fallback-test-value attribute specifies the expected CSS property value during a stylesheet fallback test.

asp-fallback-test-value supplies the CSS property value used to verify that a CDN stylesheet loaded. The tag helper applies the test class, inspects the property, and links the local fallback when the value differs. section 26.4.2

Bootstrap CDN fallback

A layout can test Bootstrap’s btn class by setting asp-fallback-test-property="display" and asp-fallback-test-value="inline-block", with asp-fallback-href pointing to the local Bootstrap file. section 26.4.2

Table 26.6. The built-in tag helper attributes for link elements (view table figure)

Name

Description

asp-href-include

This attribute is used to select files for the href attribute of the output element.

asp-href-exclude

This attribute is used to exclude files from the href attribute of the output element.

asp-append-version

This attribute is used to enable cache busting, as described in the “Understanding Cache Busting” sidebar.

asp-fallback-href

This attribute is used to specify a fallback file if there is a problem with a CDN.

asp-fallback-href-include

This attribute is used to select files that will be used if there is a CDN problem.

asp-fallback-href-exclude

This attribute is used to exclude files from the set that will be used when there is a CDN problem.

asp-fallback-href-test-class

This attribute is used to specify the CSS class that will be used to test the CDN.

asp-fallback-href-test-property

This attribute is used to specify the CSS property that will be used to test the CDN.

asp-fallback-href-test-value

This attribute is used to specify the CSS value that will be used to test the CDN.

Use the link-attribute reference to compare fallback selection, cache busting, and CSS class testing options. section 26.4.2

How Pro ASP.NET Core 7, Tenth Edition covers it

How deep it goes
Explains the generated test element and JavaScript comparison, but does not descend into tag-helper implementation internals.
Examples
Uses Bootstrap’s btn class and its display: inline-block property in a shared layout.
What it assumes
Assumes familiarity with CSS classes, CSS properties, CDN links, and local stylesheet paths.
What you can do after
Operate/configure a stylesheet link that tests a CDN resource and loads a local fallback when the expected value is absent.
How it connects
Connects CSS classes, CSS properties, CDN fallbacks, link tag helpers, and computed styles.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pro ASP.NET Core 7, Tenth Edition. The section links point to the parts of the book it draws on.