This is a migrated thread and some comments may be shown as answers.

[Solved] mvc3 razor view telerik quirks mode

1 Answer 129 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
david
Top achievements
Rank 1
david asked on 08 Sep 2011, 12:11 PM
hi,
i'm using telerik mvc version 2010.3.1318.235
when i open my mvc3 project in internet explorer 8, the page opens in Quirks Mode causing my formatting to appear incorrect.
looking into the source code, this causes my javascript script blocks being rendered right at the beginning of the page source before the DOCTYPE declaration.

i found the following solution http://stackoverflow.com/questions/5407521/mvc-3-razor-view-engine-script-blocks-appear-before-doctype
but when i apply the fix my page gets errors.

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments


Line 57:     @(Html.Telerik().ScriptRegistrar()
Line 58:             .Scripts(scripts => scripts.AddSharedGroup("TelerikJsGroup{0}"))
Line 59:             .Render()

before:
    @{
        Html.Telerik().ScriptRegistrar()
            .DefaultGroup(group => group.Enabled(false))
            .Globalization(true)
            .Scripts(scripts => scripts.AddSharedGroup("MyJsGroup{0}".FormatWith(AppHelper.VersionNumber)));

        Html.Telerik().ScriptRegistrar()
            .Scripts(scripts => scripts.AddSharedGroup("TelerikJsGroup{0}".FormatWith(AppHelper.VersionNumber)))
            .Render();
    }

after:
    @(
        Html.Telerik().ScriptRegistrar()
            .DefaultGroup(group => group.Enabled(false))
            .Globalization(true)
            .Scripts(scripts => scripts.AddSharedGroup("MyJsGroup{0}".FormatWith(AppHelper.VersionNumber)))
      )
    @(Html.Telerik().ScriptRegistrar()
            .Scripts(scripts => scripts.AddSharedGroup("TelerikJsGroup{0}".FormatWith(AppHelper.VersionNumber)))
            .Render()
    )

1 Answer, 1 is accepted

Sort by
0
david
Top achievements
Rank 1
answered on 08 Sep 2011, 12:28 PM
ah its the .render problem
Tags
General Discussions
Asked by
david
Top achievements
Rank 1
Answers by
david
Top achievements
Rank 1
Share this question
or