I have partial view inside a View in MVC 5.This partial view renders a Markdown editor in different section of the main view. Here is the Markdown Editor code in Partial view.
<div id="field comments">
</div>
var editor = new tui.Editor({
el: document.querySelector('#field comments')})
I am calling this Partial in Main view as
@Html.Partial("_MarkdownEditor")
But the problem is i want to use this Partial view in different section by passing different parameters to the "id" attribute.Some what like this,
@Html.Partial("_MarkdownEditor", new { @id = "executive comments" })
So this would create a new instance of Markdown editor with id = "executive comments" and querySelector(#executive comments).
<div id="executive comments">
</div>
var editor = new tui.Editor({
el: document.querySelector('#executive comments')})
Dynamically i need to set both 'id' attribute as well as querySelector attribute by passing the parameter in the Partial view. I am new to MVC..! Please advice..