title: Mixing razor and java script code for @Html.Partial()
body: <p>Can anyone provide me solution for how to dynamically add some code into the page in MVC.</p>
  
  <p>I was doing this way but in this code the page fails to identity index javascript variable , as it is not identifying the index javascript variable.</p>
  
  <pre><code>$(document).on('click', '.add-option', function () {           
    var index = $("div.ques-options").size();
    if (index &lt; 5) {
      $('.MainContainer').append('@Html.Partial("_Options", index)')
    }
  });
  </code></pre>