I am using summernote plugin for text field: http://summernote.org/#/getting-started#basic-api
This is the form in which I use summmernote:
<div class="modal-body" style="max-height: 600px"> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset class="form-horizontal"> <div id="textForLabelLanguage"></div> <button type="submit" class="btn btn-primary">Save changes</button> @Html.ActionLink("Cancel", "Index", null, new { @class = "btn " }) </fieldset> } </div> <script type="text/javascript"> $(document).ready(function () { $('#textForLabelLanguage').summernote(); }); </script>
Now, in my controller, this is the code I have:
public ActionResult Create(UserInfo newInfo , [Bind(Prefix = "textForLabelLanguage")] string textForLabelLanguage) {
Now the problem is that the textForLabelLanguage parameter textForLabelLanguage always null.
This is because I have to pass $('#textForLabelLanguage').code(); in MVC when submitting a form, but I have no idea how to do this!
How to solve my problem?
c # asp.net-mvc forms summernote
Flame_Phoenix
source share