5

I'm trying to add markitup text editor with markdownsharp http://markitup.jaysalvat.com/home/ to my MVC ASP project and kindof confused how to go about it. I added a class from markdownsharp and tested the function. that is working fine but confused how to embed the editor in my view. Using Visual Studia 2010. Please guide regarding the same.

0

2 Answers 2

3

The documentation contains many examples.

Sign up to request clarification or add additional context in comments.

2 Comments

There are many examples for using markitup text editor directly. I'm able to display the editor in view by using examples on the website. But how to get the values entered in the text area in asp.net mvc controller..? Basically I believe I'll need to use markdownsharp, but how i'm unable to figure out.
Also I saw this link stackoverflow.com/questions/3536324/…. I am able to use the markdownsharp. But I don't understand how to link the markitup editor in view to the markdownsharp class in c#.
0

@user488652:

As MarkItUp uses jQuery to transform a DIV into a complex editor, I am having similar issue binding the TextArea to the Model in my view.

There is one option I thought of, and it may be a better option, all things considered: make the form an AJAX-style form.

You would use jQuery to handle the Click on the Submit Button. When submitted, your handler would gather the model data and the MarkItUp editor data and fire it off to a controller action in JSON format via $.ajax().

Your controller then would receive the JSON, parse it into your objects, and use the MarkdownSharp library to do whatever logic you need, then send off the objects to your data layer for persistence.

The result may actually be better than the traditional MVC Form binding.

Good solution?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.