Try Dim picStr As String picStr = Request.QueryString("picInfo") Dim strArray(10) As String strArray(0) = picStr.Split("/")(0) strArray(1) = picStr.Split("/")(1) strArray(2) = picStr.Split("/")(2) strArray(3) = picStr.Split("/")(3) strArray(4) = picStr.Split("/")(4) strArray(5) = picStr.Split("/")(5) strArray(6) = picStr.Split("/")(6) strArray(7) = picStr.Split("/")(7) strArray(8) = picStr.Split("/")(8) strArray(9) = picStr.Split("/")(9) msg = strArray(3) Dim newPerson As String = _ "<image ID='" & strArray(0) & "'>" & Environment.NewLine & " " & _ " <filename>" & strArray(0) & "</filename>" & Environment.NewLine & " " & _ " <caption>" & strArray(1) & "</caption>" & Environment.NewLine & " " & _ "</image>" Dim xd As New XmlDocument() xd.Load(Server.MapPath("../gallery/All/gallery.xml")) xd.Load(Server.MapPath("../gallery/AwardsPatrol/gallery.xml")) xd.Load(Server.MapPath("../gallery/FundRaising/gallery.xml")) xd.Load(Server.MapPath("../gallery/NPS-History/gallery.xml")) xd.Load(Server.MapPath("../gallery/NPS-Today/gallery.xml")) xd.Load(Server.MapPath("../gallery/Projects/gallery.xml")) xd.Load(Server.MapPath("../gallery/SponsorsAndSupporters/gallery.xml")) xd.Load(Server.MapPath("../gallery/StudentLife/gallery.xml")) Dim docFrag As XmlDocumentFragment = xd.CreateDocumentFragment() docFrag.InnerXml = newPerson Dim root As XmlNode = xd.DocumentElement root.AppendChild(docFrag) ' Save the Xml. If CInt(strArray(2)) = 1 Then xd.Save(Server.MapPath("../gallery/All/gallery.xml")) End If If CInt(strArray(3)) = 1 Then xd.Save(Server.MapPath("../gallery/AwardsPatrol/gallery.xml")) End If If CInt(strArray(4)) = 1 Then xd.Save(Server.MapPath("../gallery/FundRaising/gallery.xml")) End If If CInt(strArray(5)) = 1 Then xd.Save(Server.MapPath("../gallery/NPS-History/gallery.xml")) End If If CInt(strArray(6)) = 1 Then xd.Save(Server.MapPath("../gallery/NPS-Today/gallery.xml")) End If If CInt(strArray(7)) = 1 Then xd.Save(Server.MapPath("../gallery/Projects/gallery.xml")) End If If CInt(strArray(8)) = 1 Then xd.Save(Server.MapPath("../gallery/SponsorsAndSupporters/gallery.xml")) End If If CInt(strArray(9)) = 1 Then xd.Save(Server.MapPath("../gallery/StudentLife/gallery.xml")) End If Response.Redirect("uploadPics.aspx") Catch Dim TextFile As New StreamWriter(myErrorDir & "errorUploadPicsConfirm_Submit.txt") 'C:\EHC\error\ TextFile.WriteLine(ex) TextFile.Close() myExcepValue = ex.ToString() If myExcepValue = ("cannot be a zero-length string") Then myerror = ("<font color=red size=3>Please fill out all required fields. Thank you.</font>") Response.Write(myerror) ElseIf myExcepValue.Contains("Thread was being aborted") Then 'Do nothing. This error is generated by response.redirect by design. ElseIf myExcepValue.Contains("No data exists for the row/column") Then 'Do nothing. This is probably for the spam table. Else 'Call exceptionEmail() End If End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)