Jump to content

error:javascript function is not a member of aspx file.


rhishi20

Recommended Posts

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 by rhishi20
Link to comment
Share on other sites

I imagine having the <title> tag in the script tags would be an issue.

Edited by thescientist
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...