Passing string array of HTML from WebService to Browser Javascript

Discussion in 'ASP .Net Web Services' started by Paul Hale, Mar 22, 2009.

  1. Paul Hale

    Paul Hale Guest

    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?


    Paul.
    Paul Hale, Mar 22, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    893
    Laurent Bugnion
    Jan 26, 2006
  2. msdngroup
    Replies:
    5
    Views:
    695
    msgroup
    Jan 30, 2008
  3. msdngroup
    Replies:
    0
    Views:
    575
    msdngroup
    Dec 15, 2007
  4. deadpickle
    Replies:
    1
    Views:
    946
    Jens Thoms Toerring
    Nov 7, 2010
  5. msdngroup
    Replies:
    5
    Views:
    347
    msgroup
    Jan 30, 2008
Loading...

Share This Page