title: How to use Parameters passed to Partial view in a separate javascript file
body: <p>I have a Partial view which takes in parameters and displays a Markdown Editor based on the parameters passed.</p>
  
  <pre><code>@Html.Partial("_MarkdownEditor", new { id = "fieldsection" })
  &lt;div id="@ViewData.Eval("id")"&gt; &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  var @ViewData.Eval("id") = new tui.Editor({
  el: document.querySelector('#@ViewData.Eval("id")')})
  &lt;/script&gt;
  </code></pre>
  
  <p>In the source code of the tui.Editor i have a Ajax call to a controller something like this..</p>
  
  <pre><code>$.ajax({
            url: 'Home/Index',
            success: function (data) {
                    editor.importManager.eventManager.emit('command', 'AddImage'})
  </code></pre>
  
  <p>Here the problem is with this line..</p>
  
  <pre><code>editor.importManager.eventManager.emit('command', 'AddImage)
  </code></pre>
  
  <p>Here in the place of editor i need to reference the parameters passed to Partial view..it should be like this:</p>
  
  <pre><code>fieldcomments.importManager.eventManager.emit('command', 'AddImage)
  </code></pre>
  
  <p>It should be done dynamically i have tried something like..</p>
  
  <pre><code>{@ViewData.Eval("id")}.importManager.eventManager.emit('command', 'AddImage)
  </code></pre>
  
  <p>But this doesn't work like this? How can i reference the Parameters passed to Partial view in a separate javascript file??</p>