How can I use c# code in a Javascript statement?
This is my code:
document.getElementById('part1').innerHTML = '' +
'@Html.Partial("SelectCustomer.Views")'
' Views';
@Html.Partial("SelectCustomer.Views")
and <%=
and %>
do not work
How can I use c# code in a Javascript statement?
This is my code:
document.getElementById('part1').innerHTML = '' +
'@Html.Partial("SelectCustomer.Views")'
' Views';
@Html.Partial("SelectCustomer.Views")
and <%=
and %>
do not work
@Html.Raw("document.getElementById('part1').innerHTML = '' +
@Html.Partial("SelectCustomer.Views")
' Views';");
Don't have razor project on hand to test it. Might need to remove the @ from the second Html.