This question is locked. New answers and comments are not allowed.
I just set up an existing MVC3 Razor app to use Telerik controls.
I think I have the grid control working ok, however there seems to be an issue getting the themes to work properly.
Following the local extensions example for the grid control, i ended up with this code:
But this line:
is causing an error:
Server Error in '/' Application.
Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'GetCurrentTheme' and no extension method 'GetCurrentTheme' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Source File: c:\development\MarketingWebsiteTools\MarketingWebsiteTools\Views\Shared\_Layout.cshtml Line: 13
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
Thanks
I think I have the grid control working ok, however there seems to be an issue getting the themes to work properly.
Following the local extensions example for the grid control, i ended up with this code:
@using Telerik.Web.Mvc.UI<!DOCTYPE html><html><head> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script> @(Html.Telerik().StyleSheetRegistrar() .DefaultGroup(group => group .Add("telerik.examples.css") .Add("telerik.common.css") .Add("telerik." + Html.GetCurrentTheme() + ".css") .Add("telerik.vista.css") .Add("telerik.rtl.css") .Combined(true) .Compress(true)) ) @RenderSection("HeadContent", required:false) @*@Html.Partial("_Header")*@ </head><body> <div class="page"> <div id="header"> <div id="title"> <h1>Marketing Website Tools</h1> </div> <div id="logindisplay"> Welcome <strong>@User.Identity.Name</strong>! </div> <div id="menucontainer"> <ul id="menu"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Messages", "Index", "Callouts")</li> <li>@Html.ActionLink("Flyers", "Index", "Flyers")</li> @*<li>@Html.ActionLink("Callouts", "Index", "Callouts")</li>*@ <li>@Html.ActionLink("Banners", "Index", "Banners")</li> <li>@Html.ActionLink("Buttons", "Index", "Buttons")</li> </ul> </div> </div> <div id="main"> @RenderBody() </div> <div id="footer"> </div> </div> @* @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group=>group.Add("telerik.common.css").Add("telerik.vista.css").Combined(true).Compress(true))) @Html.Telerik().ScriptRegistrar()*@ @* @(Html.Telerik().ScriptRegistrar() .DefaultGroup(group => group .Add("telerik.examples.js") .Compress(true)) .OnDocumentReady( @<text> prettyPrint(); </text>) ) *@</body></html>But this line:
.Add("telerik." + Html.GetCurrentTheme() + ".css")is causing an error:
Server Error in '/' Application.
Compilation Error
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: CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'GetCurrentTheme' and no extension method 'GetCurrentTheme' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)
Source Error:
|
Source File: c:\development\MarketingWebsiteTools\MarketingWebsiteTools\Views\Shared\_Layout.cshtml Line: 13
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
Thanks