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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -