In our ASP.NET MVC 4 app, we have four partial views: View1, View2, View3, View4. When user selects a number, say, 2, from a dropdown and click on a submit button we want to render only partial views View2. Likewise, when 3 is selected we want to render View3 and so on. I tried the following but it does not render View2. I assume we cannot do this from inside script tag.
<div id="v2">
<script>
if (n==2) {
@{Html.RenderPartial("View2");}
}
</script>
</div>
How can we achieve the above?