To use Browser Conditionals with Telerik ScriptRegistrar use the Browser Extension method and make a Test.

The Test method exposes an Func<HttpBrowserCapabilities, bool> so you can make any type of test over the Browser object of the Request.

Ex.:

<% Html.Telerik()
       .ScriptRegistrar()
       .Browser(script =>
               script.Add("myScript.js").Test(browser => browser.MajorVersion > 8); %>
You can do the Test before adding scripts:

<% Html.Telerik()
       .ScriptRegistrar()
       .Browser(script =>
               script.Test(browser => browser.MajorVersion > 8)
                     .Add("myScript.js")); %>
And also you can make a Test on DefaultGroup or SharedGroups:

<% Html.Telerik()
       .ScriptRegistrar()
       .DefaultGroup(group =>
                     group.Add("myScript.js").Test(browser => browser.MajorVersion > 8)); %> 

Last edited Jun 10, 2011 at 3:18 AM by luizbon, version 2

Comments

No comments yet.