I'm trying to get RadDock working in an MVC3 application.
Everything looks fine in VS but when I run the application I get the following error (see below).
I have followed the steps described in the help file "RadControls for ASP.NET AJAX Documentation", section "Integrating RadControls in ASP.NET MVC" > "Getting Started".
Has anyone got suggestions where the problem lies?
Has anybody got the RadDock working in MVC3?
Server Error in '/' Application.
The resource cannot be found.Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/Home/Index.aspx
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
7 Answers, 1 is accepted
This happens if you set any of the aspx pages as a startup page in Visual Studio - the aspx in MVC cannot be accessed directly. To undo that action, right-click on the project in Visual Studio and select Properties. Go to the Web tab and delete the content of the "Specific Page" field.
All the best,
the Telerik team
The "Specific Page" field was already empty. "Current Page" is selected.
I followed the next steps to create the application :
(1) Telerik > MVC UI Extentions > Create New Telerik Project : all defaults used
(2) Added references to Telerik.Web.Design.dll and Telerik.Web.UI.dll in directory C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q1 2011\Bin40.
(3) drop RadScriptManager on Site.Master, choose register in the smart menu
(4) Modify the web.config
-add the following code to tag httphandlers
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
-add the following code to tag handlers
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
(5) Added RadMenu within the form tag of Index.aspx :
<telerik:RadMenu runat="server" ID="RadMenu1" Skin="Web20">
<telerik:RadMenuItem Text="Home" NavigateUrl='<%# Url.Action("Index", "Home") %>' />
<telerik:RadMenuItem Text="About" NavigateUrl='<%# Url.Action("About", "Home") %>' />
Choosing "Current Page" in the options is basically the same as specifying a startup page - in both cases you would get an error because in MVC, aspx pages cannot be accessed directly. To avoid the problem you should clear the startup page setting - this can be done by selecting the "Specific Page" option and clearing the field next to it.
For convenience I attached a short movie that shows this approach in action. In it, I am using the application that is created when you follow the instruction in the documentation. I hope this helps.
the Telerik team
Now I'm getting the error :
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
Is it possible to post the source code of your application?
I want to check the difference with my code.
This is a general error that is not related to the RadControls that you are using. The easiest way to avoid it is to wrap the code that raises the error in RadCodeBlock or RadScriptBlock.
the Telerik team
The application runs after placing a RadCodeBlock around the next blocks :
<%: Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.black.css").Combined(true).Compress(true)) %>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<%: Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)) %>
Thanks for your great support!
I use RadCodeBlock , i try code but when i type Html.Telerik() , VS 2010 have a warning is Telerik is not contain.. i can not use html.Telerik .
I ready include
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
But It not work , can you help for my problen