Skip to content

Commit 6c8796b

Browse files
author
Marin Bratanov
committed
docs: render modes fallback and R1 2017 update on X-UA header
1 parent 0f51d6e commit 6c8796b

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

controls/render-modes.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ position: 10
1414

1515
Some of the Telerik controls support different rendering modes. They can change the actual **HTML** that is created to facilitate use of **CSS3**, semantic tags and modern skinning mechanisms. This is controlled through their **RenderMode** property.
1616

17-
The possible options are:
17+
This article contains the following sections:
18+
19+
* [RenderMode Options](#rendermode-options)
20+
* [RenderMode Fallback Order](#rendermode-fallback-order)
21+
* [Classic RenderMode](#classic-rendermode)
22+
* [Lightweight RenderMode](#lightweight-rendermode)
23+
* [Mobile RenderMode](#mobile-rendermode)
24+
* [Auto RenderMode](#auto-rendermode)
25+
* [Setting Render Mode](#setting-render-mode)
26+
27+
## RenderMode Options
1828

1929
* **Classic** - this is the default value. It preserves the original rendering and styling that has been used before, which often means there are a lot of tables used to create layout, which results in nested elements and some markup that can be avoided.
2030

@@ -39,6 +49,46 @@ You can find a list with the controls that support alternative render modes in t
3949
>note Only one type of render mode is supported per page for each control type. For example, all RadDock controls on the page must have the same valueof the RenderMode property set. This includes instances from master pages, content pages and user controls.
4050
4151

52+
## RenderMode Fallback Order
53+
54+
In some cases setting one value for the RenderMode may result in another mode being used by the controls. This is affected by the UserAgent string of the browser used to request the page. Here follows a list of the various possibilities and how you can affect or predict them.
55+
56+
### Classic RenderMode
57+
58+
If you explicitly set this mode, it will never change. It is always the last fallback options available.
59+
60+
### Lightweight RenderMode
61+
62+
This mode targets modern browsers (IE8+, Chrome, Firefox, Edge). If the requesting browser is IE7, the controls will fall back to the Classic RenderMode. This often happens if IE runs in Compatibility Mode.
63+
64+
As of R1 2017 you can avoid this by adding the `X-UA Compatible` header with value `IE=edge` to the response:
65+
66+
````web.config
67+
<system.webServer>
68+
<httpProtocol>
69+
<customHeaders>
70+
<add name="X-UA-Compatible" value="IE=Edge"/>
71+
</customHeaders>
72+
</system.webServer>
73+
````
74+
75+
````Code-behind
76+
Response.AddHeader("X-UA-Compatible", "IE=Edge");
77+
````
78+
79+
### Mobile RenderMode
80+
81+
If the control does not support this mode, it will attempt to use the Lightweight mode.
82+
83+
When set explicitly, this mode will be used even for non-mobile browsers. It is recommended to use the Auto mode for such scenarios because the Mobile modes are tested and supported only under mobile devices.
84+
85+
### Auto RenderMode
86+
87+
This mode **attempts** to fall back to **Lightweight** in the majority of cases. The exceptions are:
88+
89+
* The requesting browser is IE7 and the version of the controls is older than R1 2017 and the `X-UA Compatible` header with value `IE=edge` is not set. In this case it will fall back to Classic.
90+
91+
* The requesting browser is identified as a mobile browser and the concrete control provides mobile-specific rendering. In this case it will fall back to Mobile.
4292

4393

4494

0 commit comments

Comments
 (0)