Hi.
First of all, I´m new to asp.net.
I have this .aspx page in my Visual Studio 2008 web project solution, with a media player control and a button which invokes it and starts playing a file:
<HTML>
<HEAD>
<script language="javascript" type="text/javascript" for="Player" event="onclick">
return Player_onclick()
</script>
</HEAD>
<BODY>
<OBJECT ID="Player" height="240" width="320" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM NAME="FileName" VALUE="tc4014-v.wmv">
<PARAM NAME="AutoStart" Value="true">
<PARAM NAME="ShowControls" Value="false">
<Embed type="application/x-mplayer2"
pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/"
src="tc4014-v.wmv"
Name=Player
AutoStart=1
Width=320
Height=240
autostart=1
ShowControls=0
</embed>
</OBJECT>
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="Play" OnClick="StartMeUp()">
<SCRIPT>
<!--
function StartMeUp ()
{
Player.URL = "http://www.powerdise.com/clock.mpg";
}
function Player_onclick() {
}
-->
</SCRIPT>
</BODY>
</HTML>
Now I want to open the designer, drag a button from the toolbox so i can invoke this StartMeUp() function from this button, e.g. in this code:
protected void Button1_Click(object sender, EventArgs e)
{
//I want to access the StartMeUp() function here!
}
Problem is that I dont know how to do this, and as soon as I drag a button onto the page and doubleclick it, a
<asp:Button ID="Button1" runat="server" Text="Button" />
line is added to the .aspx page. When the page is now loaded, and the button from before that used to work gets clicked, i get a Javascript error saying that 'Player' is not defined.
Hope you can help :)
Thanks alot for your time!
Kind regards,
Lars