title: Share enums between C# and Javascript in MVC Razor
body: <p>I have seen this useful answer to a question for adding constants into a javascript file so it can be used with razor views: <a href="https://stackoverflow.com/questions/6217028/share-constants-between-c-sharp-and-javascript-in-mvc-razor">Share constants between C# and Javascript in MVC Razor</a></p>
  
  <p>I'd like to be able to do the same except define enums, but I'm not sure how to convert the C# Enum into a constant in javascript.</p>
  
  <p>Off GetType(), there doesn't seem to be a way of actually getting at the constant value.</p>