rhishi20 Posted December 4, 2013 Share Posted December 4, 2013 (edited) I am trying to access JavaScript function player1() from asp button's onclick event, but it throws error 'player1' is not a member of 'ASP.jsvideo2design_aspx'. following is my aspx code <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="jsvideo2design.aspx.vb" Inherits="jsvideoplayer2.jsvideo2design" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><script type="text/javascript"> <title> video player </title>function player1(e){var vid=document.getElementById("video1");var play1=document.getElementById("play");if (vid.paused) { vid.play(); button.textContent = "||"; } else { vid.pause(); button.textContent = ">"; } } </script></head><body> <form id="form1" runat="server"> <div> <video id="video1"> <source src="videos/IMALAB_OpeningCeremony_v1.webm" type="video/webm" /> </video> <asp:Button ID="button1" runat="server" onclick="player1(event)" /> </div> </form></body></html> Edited December 4, 2013 by rhishi20 Link to comment Share on other sites More sharing options...
thescientist Posted December 4, 2013 Share Posted December 4, 2013 (edited) I imagine having the <title> tag in the script tags would be an issue. Edited December 4, 2013 by thescientist Link to comment Share on other sites More sharing options...
justsomeguy Posted December 4, 2013 Share Posted December 4, 2013 You're also telling it to run that function on the server, which I believe means that the function is defined in the codebehind file instead of on the page. If you're trying to run a function on the page then don't tell it to run it on the server. Link to comment Share on other sites More sharing options...
rhishi20 Posted December 5, 2013 Author Share Posted December 5, 2013 To thescientist: what should i do with title tag ? Link to comment Share on other sites More sharing options...
thescientist Posted December 5, 2013 Share Posted December 5, 2013 put it where it belongs http://www.w3schools.com/html/html_head.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now