Click here to Skip to main content
15,906,229 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For ex. if i click the play button after audio streaming same button will change to pause or stop . what is the procedure? actually i'm newbie for c# asp.net im developing media player application. thanks & sorry for my bad english
Posted
Updated 27-Feb-13 23:51pm
v2

C#
protecred void btnPlay_Click(object sender, EventArgs e)
{
   btnPlay.Text = (btnPlay.Text == "Play") ? "Pause" : "Play";
}
 
Share this answer
 
Comments
Raje_ 28-Feb-13 6:51am    
+5, for using this approach.
Asim Mahmood 28-Feb-13 7:26am    
Thanks
Hi,
Within a Single Button Event If you want to Execute More than one condition what you can do is
According to your Example what you can do is, within the Button event check the text of the Button and Give the Operations Accordingly.

Eg:-

C#
protected void BtnPlay_Click(object sender, ImageClickEventArgs e)
{
if(BtnPlay.Text=="Play")
{
//Your 1st Operation
BtnPlay.Text="Pause";
} else if(BtnPlay.Text=="Pause")
{
//Your 2nd Operation
BtnPlay.Text="Play";
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900