c# - Call server side function from javascript asp.net -
i need track when user clicks play on wistia embedded video. need write sql db name of video , logged in user. have built need call server side function javascript. here script code:
<script> wistiaembed = wistia.embed("zt4tf4py2t"); wistiaembed.bind("play", function () { alert("play"); // call c# function here return this.unbind; }); </script>
thanks, sam
the simplest solution send post via ajax. if you're using jquery, this:
$.ajax('/your/url/here.aspx?videoid=1');
then in asp.net code, add page checks request parameter , saves information database. if you're using mvc, controller action.
Comments
Post a Comment