Need Help Manipulating Strings (Remove/Replace)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pbd22

    #1

    Need Help Manipulating Strings (Remove/Replace)

    Hi.

    How Do I "UPDATE" a previously created string?
    I have a problem where an XML string created in
    an event handler fails because the string doesn't "UPDATE"
    each time the event hanlder fires, but "APPENDS",
    creating lots of repetition in the XML:

    Quote:
    XML Parsing Error: junk after document element

    Location: http://localhost:5223/Presentation/set/progress.aspx
    Line Number 1, Column 191:<?xml version='1.0' encoding='ISO-8859-1'?
    ><uploads><uplo ad><filename>So meVideo.gvi</filename><bytes sent>0</
    bytessent><file size>12444894</filesize><perce nt>0</percent></upload></
    uploads><?xml version='1.0' encoding='ISO-8859-1'?...

    and, the built string inside the event handler method
    looks like this:

    Code:

    Dim sbhtml As New System.Text.Str ingBuilder
    sbhtml.Append(" <Some XML Tag>")
    etc...
    Context.Respons e.ContentType = "text/xml"
    Response.Write( sbhtml.ToString )

    So, how do I update the string each time the event handler
    fires, not append more xml to the recently created string?

    Thanks.
    Peter

  • ClayB

    #2
    Re: Need Help Manipulating Strings (Remove/Replace)

    You might try calling Response.Clear before your do your
    Response.Write.

    =============== =========
    Clay Burch
    Syncfusion, Inc.

    Comment

    Working...