﻿
{"id":1358,"date":"2013-02-02T17:03:12","date_gmt":"2013-02-02T17:03:12","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=1358"},"modified":"2013-02-02T17:08:32","modified_gmt":"2013-02-02T17:08:32","slug":"asp-net-mvc-ckeditor-entegresi-ve-kullanimi","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/asp-net-mvc-ckeditor-entegresi-ve-kullanimi\/","title":{"rendered":"Asp.NET MVC CKEditor Entegresi ve Kullan\u0131m\u0131"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Makale bazl\u0131 web projelerinde olduk\u00e7a kullan\u0131\u015fl\u0131 ve bir o kadar g\u00f6rsel CKEditor, MVC projelerine nas\u0131l entegre edilir inceleyelim.<br \/>\n<!--more--><br \/>\n\u0130nternette ara\u015ft\u0131rmalar\u0131m sonucunda, T\u00fcrk\u00e7e siteler de bu konu hakk\u0131nda detayl\u0131 ve \u00e7al\u0131\u015fabilir bir anlat\u0131m bulunmamaktad\u0131r.Haliyle u\u011fra\u015flar\u0131m\u0131n olumlu sonucu neticesinde, T\u00fcrk\u00e7e kaynak s\u0131k\u0131nt\u0131s\u0131 olan bu konuyu sizlere detayl\u0131 bir \u015fekilde g\u00f6stermek istiyorum.<\/p>\n<p>CKEditor&#8217;\u00fcn bu yaz\u0131n\u0131n yaz\u0131ld\u0131\u011f\u0131 tarihte en son versiyonuna <a href=\"http:\/\/www.gencayyildiz.com\/blog\/asp-net-mvc-ckeditor-entegresi-ve-kullanimi.html\/ckeditor\" target=\"_blank\" rel=\"attachment wp-att-1359\">buradan<\/a> ya da <a href=\"http:\/\/ckeditor.com\/download\" target=\"_blank\">http:\/\/ckeditor.com\/<\/a> orjinal sitesinden ula\u015fabilirsiniz.<\/p>\n<p>\u0130lk ad\u0131m olarak, indirdi\u011fimiz CKEditor dosyas\u0131n\u0131 rardan \u00e7\u0131kard\u0131ktan sonra, &#8220;ckeditor&#8221; dosyas\u0131n\u0131 projemizin ana dizinine atal\u0131m.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/asp-net-mvc-ckeditor-entegresi-ve-kullanimi.html\/ckeditor1\" rel=\"attachment wp-att-1361\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1361\" alt=\"ckeditor1\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2013\/02\/ckeditor1.png\" width=\"159\" height=\"120\" \/><\/a><\/p>\n<p>Asp.NET MVC&#8217;de CKEditor eklentisini sistemimize bu \u015fekilde entegre etmi\u015f olduk.Biliyorum \u00e7ok daha kompleks bir yap\u0131 bekliyordunuz.Ama sand\u0131\u011f\u0131n\u0131z gibi, \u00f6yle DLL ler eklemeler, web.config e girmeler yok \ud83d\ude42<\/p>\n<p>As\u0131l mevzumuz olan, bu eklentiyi kullanal\u0131m.<br \/>\nKullanaca\u011f\u0131m\u0131z View katman\u0131nda \u00f6ncelikle, CKEditor&#8217;un .css ve .js dosyalar\u0131n\u0131 sayfaya entegre edelim.Tabi bu i\u015flemi direkt MasterPage sayfas\u0131nda(Mesela _Layout.cshtml) yapmam\u0131z daha kolayla\u015ft\u0131r\u0131c\u0131 olacakt\u0131r.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    @Scripts.Render(&quot;~\/Scripts\/jquery-1.7.1.min.js&quot;)\r\n    @Scripts.Render(&quot;~\/ckeditor\/ckeditor.js&quot;);\r\n    @Scripts.Render(&quot;~\/ckeditor\/ckfinder\/ckfinder.js&quot;);\r\n    @Scripts.Render(&quot;~\/Scripts\/jquery.validate.js&quot;)\r\n<\/pre>\n<p>Bu i\u015flemi yapt\u0131ktan sonra CKEditor dosyam\u0131z\u0131n sayfada g\u00f6r\u00fcnmesini sa\u011flayal\u0131m.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n        @Html.TextAreaFor(model =&gt; model.OrnekProp, new { @id = &quot;editor1&quot; })\r\n        &lt;script type=&quot;text\/javascript&quot;&gt;\r\n            var editor = CKEDITOR.instances&#x5B;'editor1'];\r\n            if (editor) { editor.destroy(true); }\r\n            CKEDITOR.replace('editor1', {\r\n                enterMode: CKEDITOR.ENTER_BR,\r\n            });\r\n            CKFinder.setupCKEditor(null, '@Url.Content(&quot;~\/ckeditor\/ckfinder\/&quot;)');\r\n        &lt;\/script&gt;\r\n<\/pre>\n<p>\u0130\u015fte bu kadar, MVC prosejine CKEditor eklentisi entegrasyonu yapm\u0131\u015f olduk.<br \/>\nSayfam\u0131z\u0131n g\u00f6r\u00fcnt\u00fcs\u00fc a\u015fa\u011f\u0131daki gibi olacakt\u0131r.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/asp-net-mvc-ckeditor-entegresi-ve-kullanimi.html\/ckeditor2\" rel=\"attachment wp-att-1362\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1362\" alt=\"ckeditor2\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2013\/02\/ckeditor2.png\" width=\"967\" height=\"313\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2013\/02\/ckeditor2.png 967w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2013\/02\/ckeditor2-300x97.png 300w\" sizes=\"auto, (max-width: 967px) 100vw, 967px\" \/><\/a><\/p>\n<p>Son olarakta, CKEditor T\u00fcrk\u00e7e karakter sorunu \u00e7\u0131karmaktad\u0131r.Bu s\u0131k\u0131nt\u0131n\u0131n muhtemelen CKEditor taraf\u0131ndan \u00e7\u00f6z\u00fclebilmesi m\u00fcmk\u00fcnd\u00fcr.Ancak ben bulamad\u0131m.Bu y\u00fczden static bir s\u0131n\u0131f olu\u015fturdum.CKEditor&#8217;e gelen veri bu s\u0131n\u0131ftaki static metodtan ge\u00e7irilerek T\u00fcrk\u00e7e karakter sorunu ortadan kald\u0131r\u0131lm\u0131\u015f olmaktad\u0131r.E\u011fer ba\u015fka t\u00fcrl\u00fc \u00e7\u00f6z\u00fcm bulursan\u0131z l\u00fctfen bana da bildiriniz.Yok e\u011fer bulamad\u0131ysan\u0131z, buyrun s\u0131n\u0131f\u0131 sizde kullan\u0131n\u0131z.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    public static class KarakterDuzenleyici\r\n    {\r\n        public static string KarakterDuzenle(string metin)\r\n        {\r\n            string Duzenlenmis = metin;\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#304;&quot;, &quot;I&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#305;&quot;, &quot;i&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#214;&quot;, &quot;\u00d6&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#246;&quot;, &quot;\u00f6&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;Ouml;&quot;, &quot;\u00d6&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;ouml;&quot;, &quot;\u00f6&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#220;&quot;, &quot;\u00dc&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#252;&quot;, &quot;\u00fc&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;Uuml;&quot;, &quot;\u00dc&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;uuml;&quot;, &quot;\u00fc&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#199;&quot;, &quot;\u00c7&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#231;&quot;, &quot;\u00e7&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;Ccedil;&quot;, &quot;\u00c7&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;ccedil;&quot;, &quot;\u00e7&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#286;&quot;, &quot;G&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#287;&quot;, &quot;g&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#350;&quot;, &quot;S&quot;);\r\n            Duzenlenmis = Duzenlenmis.Replace(&quot;&amp;#351;&quot;, &quot;s&quot;);\r\n            return Duzenlenmis;\r\n        }\r\n    }\r\n<\/pre>\n<p>Faydalanman\u0131z dile\u011fiyle..<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar..<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Makale bazl\u0131 web projelerinde olduk\u00e7a kullan\u0131\u015fl\u0131 ve bir o kadar g\u00f6rsel CKEditor, MVC projelerine nas\u0131l entegre edilir inceleyelim.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,345],"tags":[746,347,348,283],"class_list":["post-1358","post","type-post","status-publish","format-standard","hentry","category-asp-net-mvc","category-mvc-4-0","tag-asp-net-mvc","tag-ckeditor","tag-ckeditor-mvc","tag-mvc"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/1358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=1358"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/1358\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=1358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=1358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=1358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}