Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alejandro Ocampo 67 posts 330 karma points c-trib
    Aug 06, 2013 @ 11:57
    Alejandro Ocampo
    0

    How can I implement MarkDown Editor as a usercontrol ?

    Good morning,

    I'm trying to get up the markdown editor as a user control and use it in the umbraco backend, the thing is I've used 'MarkItUp' in visual studio to have this editor available in my web and I can't found anything to carry on with the idea, I know umbraco has a tool that do what I want, but I need to create it from scratch so , any suggestion ?

    Cheers,

    Alejandro.

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 06, 2013 @ 12:12
    Jeroen Breuer
    1

    Before you try to create it yourself did you have a look at the Markdown Editor package? Sounds like it's what you're looking for.

    Jeroen

  • Alejandro Ocampo 67 posts 330 karma points c-trib
    Aug 06, 2013 @ 12:17
    Alejandro Ocampo
    0

    Thanks jeroen for your quickly answer, but I mentioned it, I know there is a package done , but I need to do it from scratch, I know is a bit weird but I need it.

    Cheers,

    Alejandro.

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 06, 2013 @ 12:19
    Jeroen Breuer
    0

    The source code is available here so if you want to start from scratch you can use that as an example: https://markdown4umb.codeplex.com/

    Jeroen

  • Alejandro Ocampo 67 posts 330 karma points c-trib
    Aug 06, 2013 @ 12:31
    Alejandro Ocampo
    0

    Thanks jeroen , I'll have a look on this, anyway I'm still open to suggestions.

    Cheers,

    Alejandro.

  • Alejandro Ocampo 67 posts 330 karma points c-trib
    Aug 22, 2013 @ 21:18
    Alejandro Ocampo
    100

    I could solve it but I forget to post my solution maybe is useful for someone:

    I've use MarkItUp to get this out, this is my usercontrol:

    <asp:TextBox ID="TextBox1" TextMode="MultiLine" CssClass="markItUp" runat="server"></asp:TextBox>
        <!-- markItUp! -->
        <script type="text/javascript" src="/scripts/markitup/jquery.markitup.js"></script>
        <!-- markItUp! toolbar settings -->
        <script type="text/javascript" src="/scripts/markitup/sets/markdown/set.js"></script>

    <script type="text/javascript">
        $(function () {
            $('.markItUp').markItUp(mySettings);
        });
    </script>

    and this is the .acsx.cs file :

     protected override void OnInit(EventArgs e)
             {
                 var skin = new Literal { Text = "<link href=\"/scripts/markitup/skins/simple/style.css\" type=\"text/css\" rel=\"stylesheet\" />" };            
                 var set = new Literal { Text = "<link href=\"/scripts/markitup/sets/markdown/style.css\" type=\"text/css\" rel=\"stylesheet\" />" };
                
                 Page.Header.Controls.Add(skin);
                 Page.Header.Controls.Add(set);
             }
     
             public object value
             {
                 get
                 {
                     return TextBox1.Text;
                 }
                 set
                 {
                     if (value != null)
                     {
                         TextBox1.Text = value.ToString();
                     }
                 }

    Thanks.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies