Hi....................
Am working with ASP.NET Usin
VB for a Music Project...
I have the list of songs for a movie in a datagrid with a checkbox.If check box is checked then that song shoul play when PlaySelected button is clicked.
Here the player is taking the xml file i.e when we click on the PlaySelected button a xml file should created...
like
<playlist>
<element url="skins/skin1/songs/Movie/Aata/aata.mp3" />
<element url="'/>
</playlist>
I have the following code....
Private Sub playSelected()
Dim check As Boolean
Dim Music As New MusicMachine
Dim strname As String = Music.GetMusicFileId
Dim item As DataGridItemDim writer As New XmlTextWriter(Server.MapPath("~\XML\") & strname & ".xml", Encoding.UTF8)
writer.WriteStartDocument()
writer.WriteStartElement("playlist")
Try
For Each item In FileSystemGrid.Items Dim chkBx As CheckBox = CType(item.Cells(0).FindControl("deletethis"), CheckBox)
If chkBx.Checked Then
check = True
writer.WriteElementString("element", "")
writer.WriteAttributeString("url", "Skins\skin1\Songs\" & Request.QueryString("Type") & "\" & Request.QueryString("Name") & "\" & item.Cells(2).Text)
Page.RegisterStartupScript("Popup", "<script> popUp('player.aspx');</script>")
End If
Next
If check = False Then
Response.Write("<script language=""javascript"">alert('Select at least One Song!');</script>")
End If
writer.WriteEndElement()
writer.WriteEndDocument()
writer.Close()
Catch ex As Exception
Response.Write(ex.Message)
Response.End()
End Try
End Sub
................................
But the above code is not working,It is displaying a error like
Token StartAttribute in state Content would result in an invalid XML document.
Please help me out
Thanks in Advance