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

Using RadDock with MVC3

7 Answers 214 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 2
Mario asked on 27 Jun 2011, 05:03 PM
Hi,

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

Sort by
0
Georgi Tunev
Telerik team
answered on 28 Jun 2011, 08:08 AM
Hi Mario,

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,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mario
Top achievements
Rank 2
answered on 28 Jun 2011, 08:48 AM
Hi Georgi,

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">
    <Items>
        <telerik:RadMenuItem Text="Home" NavigateUrl='<%# Url.Action("Index", "Home") %>' />
        <telerik:RadMenuItem Text="About" NavigateUrl='<%# Url.Action("About", "Home") %>' />
    </Items>
</telerik:RadMenu>
0
Georgi Tunev
Telerik team
answered on 29 Jun 2011, 12:44 PM
Hello again Mario,

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.

Greetings,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mario
Top achievements
Rank 2
answered on 29 Jun 2011, 03:22 PM
Hello Georgi,

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.

Thx!
Mario
0
Accepted
Georgi Tunev
Telerik team
answered on 30 Jun 2011, 10:13 AM
Hi Mario,

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.

Best wishes,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mario
Top achievements
Rank 2
answered on 04 Jul 2011, 08:49 AM
Georgi,

The application runs after placing a RadCodeBlock around the next blocks :

<telerik:RadCodeBlock runat="server">

<script src="<%: Url.Content("~/Scripts/jquery-1.4.4.min.js") %>" type="text/javascript"></script>

<%: Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.black.css").Combined(true).Compress(true)) %>

</telerik:RadCodeBlock>


and

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<%: Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)) %>

</telerik:RadCodeBlock>


Thanks for your great support!

Grtz
Mario
0
Exclamation
Top achievements
Rank 1
answered on 10 Jul 2012, 04:28 PM
Hi, Telerik term
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
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Mario
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Mario
Top achievements
Rank 2
Exclamation
Top achievements
Rank 1
Share this question
or