0

i have this code in javascript:

var value1 = 'name1';
var value2 = 'name2';
var dropdownlist = '@Html.Raw(@HttpUtility.JavaScriptStringEncode(@Html.DropDownList(value1, (IEnumerable<SelectListItem>)TempData[value2], new { @class = "control" }))).ToHtmlString()';

as you see: i want pass variables into TempData[value2], but error message arrised: The name 'value2' does not exist in the current context.

any help please?

Zezo
  • 13
  • 1
  • 3

0 Answers0