Probably best easiest to expose them as properties of your page (or master page if used on every page) and reference them via page directives.
<script type="text/javascript">
var userID = '<%= UserID %>';
var courseID = '<%= CourseID %>';
.... more stuff....
</script>
Then set the values on Page_Load (or in the Page_Load for the master page).
public void Page_Load( object source, EventArgs e )
{
UserID = Session["userID"];
CourseID = Session["courseID"];
...
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…