Using MVC - Kendo lacks compared to AJAX, which will not work

5 posts, 1 answers
  1. George
    George avatar
    73 posts
    Member since:
    Oct 2014

    Posted 02 Feb 2015 Link to this post

    I was using ASP.NET AJAX but switched to MVC for device and windowing reasons.  I wrote a tool to create forms using ASP Rad controls that works very nice. I need to be able to the create all the controls in C# code and then feed them into the page for the user to use.  I can find nothing that shows me how I would create controls in C# with Kendo.  My guess at the moment is to create Kendo ui in server code using strings.  That does not work with Rad, it requires objects to be created and added to collections which is a much better coding practice then creating strings (which does save memory and processing verses objects).

    My preference, since I already have working Rad generating code, is to get Rad controls working in my ASP MVC 5 project, Visual Studio 2013.  

    I have an asax file that is loaded in a cshtml file using RenderPartial

    @model SignupList.Models.FormGroupViewModel
    @{
        ViewBag.Title = "FormGroup";
    }
    <h2>Group Form </h2>
        <div>
            @{
            Html.RenderPartial("GroupForm");
            }
        </div>
     which loads
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GroupForm.ascx.cs" Inherits="SignupList.Views.Group.GroupForm" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI.ComboBox" tagprefix="cc1" %>
    <h2>Join Form</h2>
    <p>Create the membership form.</p>
    <form id="form1" runat="server">
        <telerik:RadTextBox ID="InputDateTimeWidth" InputType="Number" EmptyMessage="Pixels" Columns="12" MaxLength="10" RunAt="server"></telerik:RadTextBox>
    </form>

     This gives an error page from authentication providing an HTTP Exception caused by an unhandled exception
    {"Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'."}


    Instead trying to put a RadTextBox in a form in a cshtml page without a runat results in nothing showing with no errors - just blank.

    So, Rad does not seem to work at all and seems to be discouraged anyway.  Browsing the forums seem to show Rad working in MVC, I do wonder what I need to do.  Every time the question is asked the answer is don't use Rad even though there are clearly people using Rad controls.

    I could use Kendo if I could create controls in server code AND if the Kendo editor was as good as the Rad one.  The Rad ones seems to keep getting better while Kendo promises may be happening but are not shown in the demos.  HTML View was promised several versions ago but is still not in any demo.

    The Rad Editor has two very important features I require.  An edit HTML view and the ability to download images and pick them for the document. Interesting that the Kendo controls are being pushed so much when the Rad ones are so much better.  If you give me a way to do the HTML view, please provide actual instructions rather than a reference that does not really show how to do it.  It is amazing how often code is given in partial solutions without instructions on where to put it.

    Thanks,
    George
  2. George
    George avatar
    73 posts
    Member since:
    Oct 2014

    Posted 03 Feb 2015 in reply to George Link to this post

    I played with trying to create Kendo controls with no success. Could not figure out a way to return a string with the control defined and have it execute.  I can do that with HTML 5 controls so I guess I will be change my form generator the currently spits out Rad control object to spit out HTML 5 instead.

    Got some luck getting a Rad Button to display on an partial ascx page.  The trick was drilling down into exceptions that were being returned.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Answer
    Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 05 Feb 2015 Link to this post

    Hello George,

    What KendoUI for ASP.NET MVC provides you with is the Html extensions which allow you to just configure the JavaScript widgets with C# code. We do not provide any infrastructure how to render partial views or create HTML in the controller. The closest that we can suggest is to create a predefined extension helper which will render a kendo widget with predefined settings. How to do so is covered here:

    http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/faq#how-do-i-create-a-helper-method-that-renders-a-predefined-widget-which-i-can-further-configure

    Kind Regards,
    Petur Subev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. George
    George avatar
    73 posts
    Member since:
    Oct 2014

    Posted 05 Feb 2015 Link to this post

    That is not sufficient for my needs of building a form in server code that is given to the page as a object collection or string. I require being able to set all properties.

    Got ASP.NET AJAX working in an ascx in MVC so I will use the Rad controls. Telerik really needs to get ASP.NET AJAX Rad controls working in Razor MVC pages.

    It would be great to create Telerik controls as @Telerik.Menu( letting the C# code define the control like you can with html controls, @Html.EditorFor(
  6. George
    George avatar
    73 posts
    Member since:
    Oct 2014

    Posted 12 Feb 2015 in reply to George Link to this post

    I posted a ticket about this and the answer is ASP.NET AJAX controls cannot get their images and styles because the MVC lifecycle is not complete.  I need ASP.NET AJAX controls, Kendo editor lacks and Kendo can be created in code so I am redoing my project in ASP.NET.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready