0

I want to write a razor code

@Html.DropDownList("","Select One") 

inside javascript function

$function() 

in a partial view.

ekad
  • 14,436
  • 26
  • 44
  • 46
  • 2
    You can't, Razor is running on the server side, and javascript on the client side. What are you exactly trying to do? If you're trying to select an element of a dropdown list, you could do it by simple javascript code. – Jordi Flores Sep 21 '16 at 06:10
  • 2
    Possible duplicate of [Mix Razor and Javascript code](http://stackoverflow.com/questions/5614941/mix-razor-and-javascript-code) – John Wu Sep 21 '16 at 06:11

0 Answers0