Returning ViewBag inside @Html.DropDownListFor inside single quotes
问题 I have a DropDownListFor working this way: <div class="form-horizontal" id=CurrencyDataBlock> @Html.DropDownListFor(model => model.Code, ViewBag.Currency as SelectList, "--Select Currency--", new { @class = "btn btn-default col-xs-12 col-xs-offset-0 col-sm-2" }) </div> I have a javascript function that creates a container and fields. For this function, I pass the whole container between single quotes this way: var part1 = '<br><br><hr style="height:1px;border:none;color:#333;background-color: