DNL
Guest
|
Posted:
Wed Nov 02, 2005 9:30 pm Post subject:
WMP control via C# in ASP.NET webapplication |
|
|
I manually added an embedded WMP object into my webform I now can set the
parameters and the player works nicely, however: I would like to control all
the functions (play, pause, forward, etc....) of the player using C# code. My
aim is to have a custom button used for playing the audiofile. I have no idea
how to do this. When I add a button to the form, obviously the following code
is written:
protected System.Web.UI.WebControls.Button Button1;
How do i declare the variable for the WMP object? How do I use the variable
to make the WMP object play the audio file?
|
|
Neil Smith [MVP Digital M
Guest
|
Posted:
Thu Nov 03, 2005 5:30 pm Post subject:
Re: WMP control via C# in ASP.NET webapplication |
|
|
On Wed, 2 Nov 2005 11:46:02 -0800, DNL <DNL@discussions.microsoft.com>
wrote:
| Quote: | I manually added an embedded WMP object into my webform I now can set the
parameters and the player works nicely, however: I would like to control all
the functions (play, pause, forward, etc....) of the player using C# code. My
aim is to have a custom button used for playing the audiofile. I have no idea
how to do this. When I add a button to the form, obviously the following code
is written:
protected System.Web.UI.WebControls.Button Button1;
How do i declare the variable for the WMP object? How do I use the variable
to make the WMP object play the audio file?
|
You probably don't want to use .NET to actually control the player.
The reason for this is that ASP.NET works mostly on PostBack rather
than client side script. So each time you post the settings back to
the server, your page (and the player inside it) will unload and stop
playing.
Include the code into your output instead, say from a static file.
Cheers - Neil |
|