c# - Render enumeration value using code blocks -


i want value of jsonstr be

"{submitofferresult: 0}" 

instead though

"{submitofferresult: offer_accepted}"  //javascript var jsonstr = "{submitofferresult: <%=submit_offer_result.offer_accepted %>}";  //c# public enum submit_offer_result {     offer_accepted = 0,     qualifying_offer_not_met = 1,     offer_accepted_not_highest_offer = 2,     osp_closed = 3,     auto_rejected = 4 } 

you need cast enum numeric type:

(int)submit_offer_result.offer_accepted 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -