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

[Solved] Html.Telerik().StyleSheetRegistrar & ScriptRegistrar

2 Answers 151 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.
Roy
Top achievements
Rank 1
Roy asked on 08 Oct 2012, 03:56 PM
I am using MVC 3 razor engine and I started to try out some UI features provided by telerik extension. I guess the first thing I am stumbled with is this StyleSheetRegistrar & ScriptRegistrar methods provided by telerik helper, which registers a group of telerik-related stylesheets like "telerik.examples.css, telerik.common.css, telerik.rtl.css, etc.
1. Can I just register them in _Layout.cshtml as the following:
 <link href="@Url.Content("~/Content/telerik.examples.css")" rel="stylesheet" type="text/css" />
 <link href="@Url.Content("~/Content/telerik.common.css")" rel="stylesheet" type="text/css" />
2. Is there a good resource for telerik-extension and razor related topics?
3. We are not sure whether we want to stick with telerik-extension or move forward to Kendo UI. We are not aiming at MVC 4 for our current projects so we knew probably telerik-extension will work just fine, but we definitely don't want to invest our time on some transitional products such as some windows OS like Windows vista or ME?
Thanks!

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 08 Oct 2012, 04:37 PM
Hi Roy,

1. Yes, you can.

2. http://www.telerik.com/help/aspnet-mvc/using-with-the-razor-view-engine.html

3. I recommend you to go with Kendo UI, and possibly its MVC wrappers. Development on the MVC extensions has been discontinued, except for bug fixes.

http://www.kendoui.com/faq/mvc-faq.aspx

All the best,
Dimo
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Pritam
Top achievements
Rank 1
answered on 17 Oct 2012, 04:43 PM
I am using MVC4 with Razor in adding AutoFac DI. When I am trying to use Html.Telerik() or Html.Telerik().StyleSheetRegistrar & ScriptRegistrar I am getting following error -
Index was out of range. Must be non-negative and less than the size of the collection.<br>Parameter name: index

Stack Trace -

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><code><pre>[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.ThrowHelper.ThrowArgumentOutOfRangeException() +72
   System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +9576778
   Telerik.Web.Mvc.UI.HtmlHelperExtension.Telerik(HtmlHelper`1 helper) +43
   ASP._Page_Views_Shared__Layout_cshtml.Execute() in f:\Pritam\TEE\TEE\Presentations\TEE.Web\Views\Shared\_Layout.cshtml:14
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +209
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +97
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +235
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +12
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +67
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +65
   System.Web.WebPages.WebPageBase.PopContext() +247
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +98
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +258
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +92
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +126
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +45
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +61
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +49
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +49
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862381
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184</pre></code></font>
Tags
General Discussions
Asked by
Roy
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Pritam
Top achievements
Rank 1
Share this question
or