WMP control via C# in ASP.NET webapplication
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
WMP control via C# in ASP.NET webapplication

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web
Author Message
DNL
Guest





Posted: Wed Nov 02, 2005 9:30 pm    Post subject: WMP control via C# in ASP.NET webapplication Reply with 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?

Back to top
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 Reply with quote

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
Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB