Opinions please...
We have a web based application that is template driven. The template, HTML code, contains elements that we want to replace with code-generated HTML snippets (e.g. <FORM/> would be replaced with an HTML <form> Stuff here</form> element created by code).
We have two paths there. First we can load the template into a StringBuilder object and use the .Replace method to perform the string replacement. Second, we can load the template into an XmlDocument object and replace the element using the replaceChild method.
Both are fairly straightforward in nature, so the question is this: is one "better" than the other? Speed? Memory usage? This substitution is going to be used very heavily as each page of the site will be built using this code.
Any suggestions?
Thx
Tim
We have a web based application that is template driven. The template, HTML code, contains elements that we want to replace with code-generated HTML snippets (e.g. <FORM/> would be replaced with an HTML <form> Stuff here</form> element created by code).
We have two paths there. First we can load the template into a StringBuilder object and use the .Replace method to perform the string replacement. Second, we can load the template into an XmlDocument object and replace the element using the replaceChild method.
Both are fairly straightforward in nature, so the question is this: is one "better" than the other? Speed? Memory usage? This substitution is going to be used very heavily as each page of the site will be built using this code.
Any suggestions?
Thx
Tim