Passing string array of HTML from WebService to Browser Javascript


Paul Hale

I would like to pass back a string[] object from a c# web service to a client
browser JavaScript function. Each string in the array will contain HTML that
I will append to the already loaded page. I know I can pass back XML or JSON
but if possible I want to pass back HTML. Reason being that I have already
written a somewhat complicated utility function that builds my HTML strings
for me server side. If I pass back key values in either XML \ JSON I will
have to rewrite my utility function that builds the HTML in JavaScript and I
don’t want to have to maintain dual utility functions that do the same thing.

If this is not possible can I somehow encode the HTML in either XML or Json
and decode with a bit of javascript on the client?



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question