Using RadDock with MVC3

Thread is closed for posting
8 posts, 1 answers
  1. Mario
    Mario avatar
    5 posts
    Member since:
    Jun 2011

    Posted 27 Jun 2011 Link to this post

    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

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 28 Jun 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mario
    Mario avatar
    5 posts
    Member since:
    Jun 2011

    Posted 28 Jun 2011 Link to this post

    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>
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Jun 2011 Link to this post

    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.

  6. Mario
    Mario avatar
    5 posts
    Member since:
    Jun 2011

    Posted 29 Jun 2011 Link to this post

    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
  7. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 30 Jun 2011 Link to this post

    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.

  8. Mario
    Mario avatar
    5 posts
    Member since:
    Jun 2011

    Posted 04 Jul 2011 Link to this post

    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
  9. Exclamation
    Exclamation avatar
    10 posts
    Member since:
    Aug 2012

    Posted 10 Jul 2012 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017