How do I give JavaScript variables data from ASP.NET variables?

后端 未结 9 1082
野趣味
野趣味 2020-11-28 08:46

I have created a SCORM API for our LMS and right now I am using hard coded userID and courseID variables (variables that reference things in the database). I need to pass th

9条回答
  •  悲哀的现实
    2020-11-28 09:13

    I'm not sure about SCORM or .ashx files (no experience there) but as far as getting values from ASP.NET you can do all sorts of things like

    var xyz = '<%= variable %>';
    

    from within your ASP.NET page. There are various ways to accomplish this but the end result is that the ASP.NET page renders the values of the variable in the HTML (or JavaScript) that is sent to the browser.

    This is a generic ASP.NET and JavaScript answer, there may be a more elegant solution out there for you.

提交回复
热议问题