I am trying to set the innerHTML of a div in a full razor view with the contents of a partial razor view as such:
@{
MvcHtmlString Bobo = @Html.Action("_TaskDetail_E", "ProTask");
};
detail_popup.innerHTML = @Bobo;
I try this code in my partial view it gives me an Unterminated string constant Error:
'<p>Task Name: @Html.DisplayFor(model => model.TaskName)</p>
<p>Task Description: @Html.DisplayFor(model => model.TaskDesc)</p>'
when I use the following code in the partial view it displays fine:
'<p>Task Name: @Html.DisplayFor(model => model.TaskName)</p>' +
'<p>Task Description: @Html.DisplayFor(model => model.TaskDesc)</p>'
If I put all the code on one line in one single quoted string it works fine also. My real partial view is many lines long and single quoting every line and putting a '+' on the end of each is pretty ugly. Can someone tell me how this is normally done?
Task Name: @Html.DisplayFor(model => model.TaskName)
\" is not valid at the start of a code block. Only identifiers, keywords, comments, \"(\" and \"{\" are valid.\r\n"}" – Robert Wells Dec 14 '16 at 23:03Task Name: Submit Building Plan
Task Description: Submit Building Plan to Appropriate authorities for approval
" – Robert Wells Dec 18 '16 at 15:53Task Name: Submit Building Plan
Task Description: Submit Building Plan to Appropriate authorities for approval
" Any ideas? – Robert Wells Dec 18 '16 at 15:58