In my website i have a script that return the current song that playing from my shoutcast server in a format of: "artist-track", what i want to do is to take that string and split it to 2 strings: artist and track, in order to do that i wrapped the script in server tag like this:
<div id="nowPlaying" runat="server">
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk3-free:34588"></script>
</div>
and on code behind i did somthing like this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim query() As String = nowPlaying.InnerText.Split("-")
Dim artist As String = query(0)
Dim track As String = query(1)
Response.Write(artist + "<br />" + track)
End Sub
the problem is that for some reason the string array is allways empty in fact i am unable to do any manipulation at all (remove, substring. lastIndexOf etc.) it allways seems to be empty.
but if i dont do any manipulation on the string everything is ok and i can see the string like this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim query As String = nowPlaying.InnerText
Response.Write(query)
End Sub
any ideas why?