Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Streaming Music Through POST?

Status
Not open for further replies.

Merkaba

Programmer
Jun 14, 2005
69
US
I am making a ASP.NET site for my band to get our songs out there. I made a <asp:Literal> and dropped an <embed> to load the song picked from a dropdownlist.

The problem is that I want the music to continue when someone clicks a server-side link on the site. Reason being, that I have links to my Lyrics and Photos specific to each song. When they click Lyrics, I want the song to keep playing from where it was, but load the TextArea with the Song Lyrics. Currently, the song restarts when I do this.

I've tried to use an <iframe> to hold the player, but I can't get the <iframe> to function properly.

ViewState don't work either.

Sooooo, my question is, how can I Refresh one area of the current page ( the main textarea ) and keep the music playing (in a Literal Control) without a restart. I know I can use JavaScript to keep the page from posting while still changing the data loaded, but was hoping there was a way to stop the server from restarting the music while making a server-side hop (mainly cause I coded all that out already). It currently uses SQL Server 2005 as a backend, and recycles a page (Index.aspx) loading different data based on the user-selection based through web controls.


Thanks in advance...

Merk
 
The only way to do is to use an AJAX type method. Check out Client Callbacks for the ASP.NET implementation of AJAX.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Actually, another method would be to load all song lyrics when the page loads but make them hidden. You could then use javascript to show the relevant song when a user clicks a song link.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
and

>>I've tried to use an <iframe> to hold the player, but I can't get the <iframe> to function properly.

what happens???

Known is handfull, Unknown is worldfull
 
Yeah, I looked up remote scripting and all, I'm using that, trying to learn it along the way. As for the <iframe>, It just wouldn't load anything. I couldn't get it to talk to the main page, lol. Everything in .Net is pretty new to me, but I learn it quick. I was just frustrated with the <iframe> cause I couldn't find what I was trying to do, which was load a music player from a custom control I made. If I place the control right on the page, it works great, but refreshs on every hop. Exacting what I don't want it to do :p

Now, I'm having trouble with remote scripting. I'm using the Thycotic.Web.RemoteScripting class and the MSRS javascript functions for callbacks. No matter what I do, it will only call the Page_Load subroutine. In the example, they have a Page_Load sub at the top, and it still calls the right method, and I basically copied the example, just replacing what method was called. I want it to call
Code:
Public Function LoadTextBody(ByVal whatToLoad As String)
     Dim text As String
     'Grabs the dataset and retrieves the text that goes with
     'link clicked
     Return text
End Function

It seems another problem it is having is I apparently can't use ViewState() calls in remote scripting. It always has to refresh the DataSet from a database call, instead of using the ViewState, but server side calls use it fine.

Oddly enough both of these problems cause the RemoteScripting stuff to call Page_Load from the page with the right function, everytime. It goes into Page_Load, why, I don't know; but then, IsPostBack = False so it would run the initial load of the page, loading the Home page. I put a Session() call in to stop the initial load, which works, but it still won't load the right data since it still only calls Page_Load.

The only thing that does work, is the music doesn't restart when I hit the Server Objects that unfortunatly, will only run Page_Load. So I put the Function call in Page_Load, but that keep screwing up everything else, since I couldn't tell which link was clicked.

If I hardcode a value, it loads the data that goes with the value, without restarting the music, which is great! But that's not what I need, plus the ViewState() is always empty so it has to make a database call everytime a client call is made to the server, making it load slower.

I had the DataSet in a Session() variable, but that was constantly screwing thinks up, always returning Nothing for some reason. I guess I'll try Application() next.

Don't know what else to do, besides load everything into XML and fetch that with javascript as ca8msm said, but then my song paths will be visible, which I don't like.


So, anyone use remote scripting before with any ideas for it calling the right method using the Thycotic.Web.RemoteScripting Classes and the MSRS Javascript functions?

Thanks,

Merk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top