Summernote edit.cshtml获取产品ID [英] Summernote edit.cshtml fetch product id
本文介绍了Summernote edit.cshtml获取产品ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Edit.cshtml
< div class =form-group>
@ Html.LabelFor(model => model.long_Description,htmlAttributes:new {@class =control-label col-md-4})
< div id =summernote> < / DIV>
< div class =col-md-10>
@ Html.TextAreaFor(model => model.long_Description,new {@id =long_Description,@ style =display:none;,@ class =form-control})
@ Html.ValidationMessageFor(model => model.long_Description,,new {@class =text-danger})
< / div>
< / div>
< script type =text / javascript>
$(document).ready(function(){
$('#summernote')。summernote(
{
tabsize:2,
height:150
});
var editor = $('#long_Description')。html();
$('#summernote')。html(editor);
$('#editorbtn')。hover(function(){
var editor = $('。note-editable')。html();
$('#long_Description')。html(编辑);
});
});
< / script>
Create.cshtml
< div class =form-group>
@ Html.LabelFor(model => model.long_Description,htmlAttributes:new {@class =control-label col-md-4})
< div id =summernote> < / DIV>
< div class =col-md-10>
@ Html.TextAreaFor(model => model.long_Description,new {@id =long_Description,@ style =display:none;,@ class =form-control})
@ Html.ValidationMessageFor(model => model.long_Description,,new {@class =text-danger})
< / div>
< / div>
< script type =text / javascript>
$(document).ready(function(){
$('#summernote')。summernote(
{
tabsize:2,
height:150
});
var editor = $('#long_Description')。html();
$('#summernote')。html(editor);
$('#editorbtn')。hover(function(){
var editor = $('。note-editable')。html();
$('#long_Description')。html(编辑);
});
});
< / script>
< input type =submitvalue =Addid =editorbtnclass =btn btn-primary/>
我尝试了什么:
我在项目中添加了SummerNote。但我有一个问题。按产品编辑键时,SummerNote为空。我该怎么办?你会做一个说明性的例子吗?英语不好我希望你理解。谢谢。
解决方案
(文件).ready(function(){
('#summernote')。summernote(
{
tabsize:2,
height:150
});
var editor =
( '#long_Description')的HTML();
Edit.cshtml <div class="form-group"> @Html.LabelFor(model => model.long_Description, htmlAttributes: new { @class = "control-label col-md-4" }) <div id="summernote"></div> <div class="col-md-10"> @Html.TextAreaFor(model => model.long_Description, new { @id = "long_Description", @style = "display:none;", @class = "form-control" }) @Html.ValidationMessageFor(model => model.long_Description, "", new { @class = "text-danger" }) </div> </div> <script type="text/javascript"> $(document).ready(function () { $('#summernote').summernote( { tabsize: 2, height: 150 }); var editor = $('#long_Description').html(); $('#summernote').html(editor); $('#editorbtn').hover(function () { var editor = $('.note-editable').html(); $('#long_Description').html(editor); }); }); </script> Create.cshtml <div class="form-group"> @Html.LabelFor(model => model.long_Description, htmlAttributes: new { @class = "control-label col-md-4" }) <div id="summernote"></div> <div class="col-md-10"> @Html.TextAreaFor(model => model.long_Description, new { @id = "long_Description", @style = "display:none;", @class = "form-control" }) @Html.ValidationMessageFor(model => model.long_Description, "", new { @class = "text-danger" }) </div> </div> <script type="text/javascript"> $(document).ready(function () { $('#summernote').summernote( { tabsize: 2, height: 150 }); var editor = $('#long_Description').html(); $('#summernote').html(editor); $('#editorbtn').hover(function () { var editor = $('.note-editable').html(); $('#long_Description').html(editor); }); }); </script> <input type="submit" value="Add" id="editorbtn" class="btn btn-primary" />
What I have tried:
I added SummerNote to the project. But I have a problem. The SummerNote is empty when you press the product edit key. How can I fix ? Would you make an illustrative example? English is not good I hope you understand. Thank you.
解决方案
(document).ready(function () {
('#summernote').summernote( { tabsize: 2, height: 150 }); var editor =
('#long_Description').html();
这篇关于Summernote edit.cshtml获取产品ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文