Save changes to and print content of Editor in MVC

6 posts, 1 answers
  1. Goran
    Goran avatar
    7 posts
    Member since:
    Sep 2014

    Posted 19 Jan 2015 Link to this post

    Hello,

    I'm planning to use Editor in my ASP.NET MVC application to edit and print some HTML content that I store in database. But, as I could see in THIS demo Editor does not contain tools (buttons) such as Save and Print. I've used your ASP.NET Ajax editor in my previous ASP.NET Web Forms applications to achieve same functionality and that editor had this buttons.

    My question is, how can I save changes and print ONLY the content of Editor in ASP.NET MVC? Any example?
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 20 Jan 2015 Link to this post

    Hello Goran,

    At this time, the editor does not provide a print action. See this Dojo sample for a way to print via a custom tool.

    As for saving the editor content, the editor posts the textarea to the controller action when submitting the enclosing form. If you have a string argument of the action method that has the same name as the editor, you get the editor value in it:

    @Html.Kendo().Editor().Name("foo")

    public ActionResult Save(string foo) {
    }

    Regards,
    Alex Gyoshev
    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Goran
    Goran avatar
    7 posts
    Member since:
    Sep 2014

    Posted 20 Jan 2015 in reply to Alex Gyoshev Link to this post

    Thank you for your answer. Unfortunatelly, this printing works only with chrome and firefox but not IE. It prints the whole page, not just the editor content. Even if I put it in compatibility mode it still prints the whole page. Please refer to the attachment.
  5. Goran
    Goran avatar
    7 posts
    Member since:
    Sep 2014

    Posted 20 Jan 2015 in reply to Goran Link to this post

    I must add that even if it works it is fairly hard to implement. Telerik controls were supposed to the ease the development. This is very complex workaround (not a solution) for a very simple task. It's very disapointing to find out that such a simple task is not already implemented in MVC wrappers.
  6. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 21 Jan 2015 Link to this post

    Hello Goran,

    I have adjusted the approach to work in IE.

    The features that you mention are not implemented, nor advertised anywhere on the site. If you need features that are not available, you either need to wait for them to be implemented, or implement them yourself -- the suggested code is meant to help you with that.

    Saving data to the database is not a task of the UI framework, but if you need help with this in your application, feel free to open a support ticket that explains the problem.

    Regards,
    Alex Gyoshev
    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.

     
  7. Goran
    Goran avatar
    7 posts
    Member since:
    Sep 2014

    Posted 21 Jan 2015 in reply to Alex Gyoshev Link to this post

    Ok, I totally agree :) Fair enoough.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready