Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dynamic music player....

Dynamic music player....

Scheduled Pinned Locked Moved ASP.NET
help
18 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    greendragons
    wrote on last edited by
    #1

    I wanna embed an audio player.....im retrieving location of that song file from querystring which means i can't embed that player in my code behind...i have to embed that player in event handler page..... image1.AlternateText = Request.QueryString["art"];             image1.ImageUrl = Request.QueryString["imgg"];             label2.Text = image1.AlternateText;             Response.Write("<OBJECT width=312px height=248px clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 VIEWASTEXT&gt;");                Response.Write("<PARAM name=autoStart value=False>");             Response.Write("<PARAM name=URL value='" + Request.QueryString["u"] + "'>"); but the problem is that i used this page under master page...and the content of master page and other code behind contents are not visible only i see this dynamically generated player because code behind content is in content placeholder of master....is there any way that i can embed this player in my code behind but give the value of it's url from querystring....

    C A 2 Replies Last reply
    0
    • G greendragons

      I wanna embed an audio player.....im retrieving location of that song file from querystring which means i can't embed that player in my code behind...i have to embed that player in event handler page..... image1.AlternateText = Request.QueryString["art"];             image1.ImageUrl = Request.QueryString["imgg"];             label2.Text = image1.AlternateText;             Response.Write("<OBJECT width=312px height=248px clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 VIEWASTEXT&gt;");                Response.Write("<PARAM name=autoStart value=False>");             Response.Write("<PARAM name=URL value='" + Request.QueryString["u"] + "'>"); but the problem is that i used this page under master page...and the content of master page and other code behind contents are not visible only i see this dynamically generated player because code behind content is in content placeholder of master....is there any way that i can embed this player in my code behind but give the value of it's url from querystring....

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      greendragons wrote:

      .is there any way that i can embed this player in my code behind but give the value of it's url from querystring....

      I don't remotely understand this question. If you generate the HTML in your ASPX or your code behind is TOTALLY irrelevant to the end result. What on earth are you trying to ask ? Oh, you're using response.write ? To use a content page, I think you need to set up a literal in the page, and set it's content in the code, so that it appears in the right place ( inside the content holder ).

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      G 1 Reply Last reply
      0
      • C Christian Graus

        greendragons wrote:

        .is there any way that i can embed this player in my code behind but give the value of it's url from querystring....

        I don't remotely understand this question. If you generate the HTML in your ASPX or your code behind is TOTALLY irrelevant to the end result. What on earth are you trying to ask ? Oh, you're using response.write ? To use a content page, I think you need to set up a literal in the page, and set it's content in the code, so that it appears in the right place ( inside the content holder ).

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        G Offline
        G Offline
        greendragons
        wrote on last edited by
        #3

        Thnx....can u give me little idea about code so that i can use retrieved url to play music on page...

        C 1 Reply Last reply
        0
        • G greendragons

          Thnx....can u give me little idea about code so that i can use retrieved url to play music on page...

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Request.QueryString ?

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          G 1 Reply Last reply
          0
          • C Christian Graus

            Request.QueryString ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            G Offline
            G Offline
            greendragons
            wrote on last edited by
            #5

            Actually im creating a song site...user clicks the song and the location of that song is picked up from database and sent to the player page in which i want that song to be played...im sending that location value through Response.redirect......so have to be retrieved on player page through Request.Querystring...

            C 1 Reply Last reply
            0
            • G greendragons

              I wanna embed an audio player.....im retrieving location of that song file from querystring which means i can't embed that player in my code behind...i have to embed that player in event handler page..... image1.AlternateText = Request.QueryString["art"];             image1.ImageUrl = Request.QueryString["imgg"];             label2.Text = image1.AlternateText;             Response.Write("<OBJECT width=312px height=248px clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 VIEWASTEXT&gt;");                Response.Write("<PARAM name=autoStart value=False>");             Response.Write("<PARAM name=URL value='" + Request.QueryString["u"] + "'>"); but the problem is that i used this page under master page...and the content of master page and other code behind contents are not visible only i see this dynamically generated player because code behind content is in content placeholder of master....is there any way that i can embed this player in my code behind but give the value of it's url from querystring....

              A Offline
              A Offline
              Abhishek Sur
              wrote on last edited by
              #6

              hey.. dont write in response using Response.Write... Its not good. Rather place the object tag in the designer and handle from codebehind. Also if you write Respons.write("<object width... It will show you <object. Rather than using < use < itself so that browser renders the html. Now it is no big deal if you are using masterpage or not. Just in your codebehind if you want to add some reference to parameter to a serverside control, add control.ClientId rather than control.Id. hope you can do it now. :)

              Abhishek Sur


              My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

              **Don't forget to click "Good Answer" if you like to.

              G 2 Replies Last reply
              0
              • G greendragons

                Actually im creating a song site...user clicks the song and the location of that song is picked up from database and sent to the player page in which i want that song to be played...im sending that location value through Response.redirect......so have to be retrieved on player page through Request.Querystring...

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                Right, so what is the issue ? What's the legality of the songs you're putting on your site ? Where do they come from ?

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                1 Reply Last reply
                0
                • A Abhishek Sur

                  hey.. dont write in response using Response.Write... Its not good. Rather place the object tag in the designer and handle from codebehind. Also if you write Respons.write("<object width... It will show you <object. Rather than using < use < itself so that browser renders the html. Now it is no big deal if you are using masterpage or not. Just in your codebehind if you want to add some reference to parameter to a serverside control, add control.ClientId rather than control.Id. hope you can do it now. :)

                  Abhishek Sur


                  My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                  **Don't forget to click "Good Answer" if you like to.

                  G Offline
                  G Offline
                  greendragons
                  wrote on last edited by
                  #8

                  IM sry....lil' confused...:( can u write lil' in codes plzzz....

                  1 Reply Last reply
                  0
                  • A Abhishek Sur

                    hey.. dont write in response using Response.Write... Its not good. Rather place the object tag in the designer and handle from codebehind. Also if you write Respons.write("<object width... It will show you <object. Rather than using < use < itself so that browser renders the html. Now it is no big deal if you are using masterpage or not. Just in your codebehind if you want to add some reference to parameter to a serverside control, add control.ClientId rather than control.Id. hope you can do it now. :)

                    Abhishek Sur


                    My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                    **Don't forget to click "Good Answer" if you like to.

                    G Offline
                    G Offline
                    greendragons
                    wrote on last edited by
                    #9

                    coz it's object Tag means html one...not asp so how to add control id property....

                    C 1 Reply Last reply
                    0
                    • G greendragons

                      coz it's object Tag means html one...not asp so how to add control id property....

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #10

                      Here are your issues. You're trying to create some sort of pirate music site. Which I expect is for your own use, which makes me think that you're trying to pick up a bare minimum of knowledge in order to achieve it. We're not going to write all the code for you. There is no reason for the master page to make any difference. The query string is visible everywhere. In fact, your best bet, IMO, is to set up the player inside your aspx, and have some server tags which cause it to render the right properties from a code behind property, which in turn reads the query string.

                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                      G 1 Reply Last reply
                      0
                      • C Christian Graus

                        Here are your issues. You're trying to create some sort of pirate music site. Which I expect is for your own use, which makes me think that you're trying to pick up a bare minimum of knowledge in order to achieve it. We're not going to write all the code for you. There is no reason for the master page to make any difference. The query string is visible everywhere. In fact, your best bet, IMO, is to set up the player inside your aspx, and have some server tags which cause it to render the right properties from a code behind property, which in turn reads the query string.

                        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                        G Offline
                        G Offline
                        greendragons
                        wrote on last edited by
                        #11

                        what????? Im making site for my college project.....and yeah i don't know much about adding literal controls....coz i hardly use html controls instead i prefer asp controls and i also could have used mediaplayer toolkit but it's trail i have so wanted to do with html code......???????????

                        C 1 Reply Last reply
                        0
                        • G greendragons

                          what????? Im making site for my college project.....and yeah i don't know much about adding literal controls....coz i hardly use html controls instead i prefer asp controls and i also could have used mediaplayer toolkit but it's trail i have so wanted to do with html code......???????????

                          C Offline
                          C Offline
                          Christian Graus
                          wrote on last edited by
                          #12

                          Well, you went all quiet when I asked if it was legal. I appear to be spot on. This is your college project, we've explained exactly how to do it. If you're stuck, post specific code and explain why you';re still stuck. Don't just ask us for code, if you're in college, you can surely understand the explanations we've given ?

                          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                          G 1 Reply Last reply
                          0
                          • C Christian Graus

                            Well, you went all quiet when I asked if it was legal. I appear to be spot on. This is your college project, we've explained exactly how to do it. If you're stuck, post specific code and explain why you';re still stuck. Don't just ask us for code, if you're in college, you can surely understand the explanations we've given ?

                            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                            G Offline
                            G Offline
                            greendragons
                            wrote on last edited by
                            #13

                            protected void Page_Load(object sender, EventArgs e)       {             image1.AlternateText = Request.QueryString["art"];             image1.ImageUrl = Request.QueryString["imgg"];             label2.Text = image1.AlternateText;             string loc = Request.QueryString["u"];             Panel1.Controls.Add(new LiteralControl("<OBJECT width=312px height=248px CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 VIEWASTEXT >"));             Panel1.Controls.Add(new LiteralControl("<PARAM name=autoStart value=False>"));             Panel1.Controls.Add(new LiteralControl(@"<PARAM name=URL value="+loc+">"));             Panel1.Controls.Add(new LiteralControl("</OBJECT>"));       } i got it....actually i was using Response.Write what actually showing controls in browsers but not master page contents....now using this literalcontrols i did but still problem is that it's not playing the song....n my url is perfectly right........

                            G C 2 Replies Last reply
                            0
                            • G greendragons

                              protected void Page_Load(object sender, EventArgs e)       {             image1.AlternateText = Request.QueryString["art"];             image1.ImageUrl = Request.QueryString["imgg"];             label2.Text = image1.AlternateText;             string loc = Request.QueryString["u"];             Panel1.Controls.Add(new LiteralControl("<OBJECT width=312px height=248px CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 VIEWASTEXT >"));             Panel1.Controls.Add(new LiteralControl("<PARAM name=autoStart value=False>"));             Panel1.Controls.Add(new LiteralControl(@"<PARAM name=URL value="+loc+">"));             Panel1.Controls.Add(new LiteralControl("</OBJECT>"));       } i got it....actually i was using Response.Write what actually showing controls in browsers but not master page contents....now using this literalcontrols i did but still problem is that it's not playing the song....n my url is perfectly right........

                              G Offline
                              G Offline
                              greendragons
                              wrote on last edited by
                              #14

                              even i checked still not playing...is it coz im using literalcontrols.....and when im using this code in source it's playing perfectly well Panel1.Controls.Add(new LiteralControl("<OBJECT width=312px height=248px CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 VIEWASTEXT >"));             Panel1.Controls.Add(new LiteralControl("<PARAM name=autoStart value=False>"));             Panel1.Controls.Add(new LiteralControl(@"<PARAM name=URL value=F:\Songs\Britney Spears\Circus-2008\01   Britney Spears - Womanizer.mp3>"));             Panel1.Controls.Add(new LiteralControl("</OBJECT>"));

                              1 Reply Last reply
                              0
                              • G greendragons

                                protected void Page_Load(object sender, EventArgs e)       {             image1.AlternateText = Request.QueryString["art"];             image1.ImageUrl = Request.QueryString["imgg"];             label2.Text = image1.AlternateText;             string loc = Request.QueryString["u"];             Panel1.Controls.Add(new LiteralControl("<OBJECT width=312px height=248px CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 VIEWASTEXT >"));             Panel1.Controls.Add(new LiteralControl("<PARAM name=autoStart value=False>"));             Panel1.Controls.Add(new LiteralControl(@"<PARAM name=URL value="+loc+">"));             Panel1.Controls.Add(new LiteralControl("</OBJECT>"));       } i got it....actually i was using Response.Write what actually showing controls in browsers but not master page contents....now using this literalcontrols i did but still problem is that it's not playing the song....n my url is perfectly right........

                                C Offline
                                C Offline
                                Christian Graus
                                wrote on last edited by
                                #15

                                greendragons wrote:

                                Panel1.Controls.Add(new LiteralControl(""));             Panel1.Controls.Add(new LiteralControl(""));             Panel1.Controls.Add(new LiteralControl(@""));             Panel1.Controls.Add(new LiteralControl(""));

                                Create a literal on the page, then build a string, and assign that string to the one literal. It's neater. Does your URL have spaces ? Should it be in quotes ?

                                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                G 1 Reply Last reply
                                0
                                • C Christian Graus

                                  greendragons wrote:

                                  Panel1.Controls.Add(new LiteralControl(""));             Panel1.Controls.Add(new LiteralControl(""));             Panel1.Controls.Add(new LiteralControl(@""));             Panel1.Controls.Add(new LiteralControl(""));

                                  Create a literal on the page, then build a string, and assign that string to the one literal. It's neater. Does your URL have spaces ? Should it be in quotes ?

                                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                  G Offline
                                  G Offline
                                  greendragons
                                  wrote on last edited by
                                  #16

                                  Yes did that but i wanna include location value in quotes unless it won't play....but if i'll put quotes in between it will terminate the string....how to include quotes......

                                  C 1 Reply Last reply
                                  0
                                  • G greendragons

                                    Yes did that but i wanna include location value in quotes unless it won't play....but if i'll put quotes in between it will terminate the string....how to include quotes......

                                    C Offline
                                    C Offline
                                    Christian Graus
                                    wrote on last edited by
                                    #17

                                    Add \" to encode a double quote, or single quotes if you can.

                                    Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                    G 1 Reply Last reply
                                    0
                                    • C Christian Graus

                                      Add \" to encode a double quote, or single quotes if you can.

                                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                      G Offline
                                      G Offline
                                      greendragons
                                      wrote on last edited by
                                      #18

                                      Thnx alot.....

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • World
                                      • Users
                                      • Groups