View HTML KendoUI MVC

2 posts, 0 answers
  1. mdelgert
    mdelgert avatar
    4 posts
    Member since:
    Dec 2010

    Posted 10 Nov 2012 Link to this post

    Hello,

    In the attached screen print I added the HTML version 2012.2 913 of editor and MVC version code snippet from the view all http://demos.kendoui.com/web/editor/all-tools.html. The HTML version has the (View HTML) the MVC version does not have this button. I also tried the latest internal build 2012.2.1029 this did not have the feature. In the Razor file when I add .Tools(tools => tools . viewHtml is not listed as a tool.

    Below is the sample code I used to generate this. And attached is a screen print.

    With regards,

    Matthew

    Sample Index.cshtml file

    @{

        ViewBag.Title = "Index";

    }

    <h2>HTML Editor</h2>

        <div id="example" class="k-content">

        <textarea id="editor" rows="10" cols="30" style="width:740px;height:400px">

                &lt;p&gt;&lt;img src=&quot;http://www.kendoui.com/Image/kendo-logo.png&quot; alt=&quot;Editor for ASP.NET MVC logo&quot; style=&quot;display:block;margin-left:auto;margin-right:auto;&quot; /&gt;&lt;/p&gt;

                &lt;p&gt;

                    Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.&lt;br /&gt;

                    In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists,

                    and image handling. The widget &lt;strong&gt;outputs identical HTML&lt;/strong&gt; across all major browsers, follows

                    accessibility standards and provides API for content manipulation.

                &lt;/p&gt;

                &lt;p&gt;Features include:&lt;/p&gt;

                &lt;ul&gt;

                    &lt;li&gt;Text formatting &amp; alignment&lt;/li&gt;

                    &lt;li&gt;Bulleted and numbered lists&lt;/li&gt;

                    &lt;li&gt;Hyperlink and image dialogs&lt;/li&gt;

                    &lt;li&gt;Cross-browser support&lt;/li&gt;

                    &lt;li&gt;Identical HTML output across browsers&lt;/li&gt;

                    &lt;li&gt;Gracefully degrades to a &lt;code&gt;textarea&lt;/code&gt; when JavaScript is turned off&lt;/li&gt;

                &lt;/ul&gt;

                &lt;p&gt;

                    Read &lt;a href=&quot;http://docs.kendoui.com&quot;&gt;more details&lt;/a&gt; or send us your

                    &lt;a href=&quot;http://www.kendoui.com/forums.aspx&quot;&gt;feedback&lt;/a&gt;!

                &lt;/p&gt;

        </textarea>

        <script>

            $("#editor").kendoEditor({

                tools: [

                    "bold",

                    "italic",

                    "underline",

                    "strikethrough",

                    "fontName",

                    "fontSize",

                    "foreColor",

                    "backColor",

                    "justifyLeft",

                    "justifyCenter",

                    "justifyRight",

                    "justifyFull",

                    "insertUnorderedList",

                    "insertOrderedList",

                    "indent",

                    "outdent",

                    "formatBlock",

                    "createLink",

                    "unlink",

                    "insertImage",

                    "subscript",

                    "superscript",

                    "viewHtml"

                ]

            });

        </script>

    </div>

    <h2>MVC Editor</h2>

    @(Html.Kendo().Editor()

          .Name("Editor")

          .HtmlAttributes(new { style = "width: 740px;height:440px" })

          .Tools(tools => tools

            .SubScript()

            .SuperScript()

          )

          .Value(@<text>

                <p>

                   <img src="http://www.kendoui.com/Image/kendo-logo.png" alt="Editor for ASP.NET MVC logo" style="display:block;margin-left:auto;margin-right:auto;" />

                </p>

                <p>

                    Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />

                    In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists,

                    and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows

                    accessibility standards and provides API for content manipulation.

                </p>

                <p>Features include:</p>

                <ul>

                    <li>Text formatting &amp; alignment</li>

                    <li>Bulleted and numbered lists</li>

                    <li>Hyperlink and image dialogs</li>

                    <li>Cross-browser support</li>

                    <li>Identical HTML output across browsers</li>

                    <li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li>

                </ul>

                <p>

                    Read <a href="http://www.kendoui.com/documentation/introduction.aspx">more details</a> or send us your

                    <a href="http://www.kendoui.com/forums.aspx">feedback</a>!

                </p>

          </text>)

    )

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 13 Nov 2012 Link to this post

    Hello Matthew,

    Thank you for reporting this -- we have added the ViewHtml to the tools builder for the upcoming Q3 release.

    Kind regards,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top