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.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
The documentation contains many examples.
@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?