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. Advertisements

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. =?Utf-8?B?UmFqZXNoIHNvbmk=?=

    'System.String[]' from its string representation 'String[] Array'

    =?Utf-8?B?UmFqZXNoIHNvbmk=?=, May 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,997
    =?Utf-8?B?UmFqZXNoIHNvbmk=?=
    May 4, 2006
  2. Replies:
    9
    Views:
    809
    justanotherguy
    Dec 3, 2004
  3. Jonathan Underwood
    Replies:
    2
    Views:
    871
    Simon Biber
    Aug 13, 2003
  4. JW
    Replies:
    1
    Views:
    768
    David Jeske
    Jul 12, 2003
  5. Oeleboele

    passsing &array same as passing array ?

    Oeleboele, Aug 6, 2004, in forum: C Programming
    Replies:
    5
    Views:
    605
    Oeleboele
    Aug 9, 2004
  6. msdngroup
    Replies:
    5
    Views:
    973
    msgroup
    Jan 30, 2008
  7. deadpickle
    Replies:
    1
    Views:
    1,547
    Jens Thoms Toerring
    Nov 7, 2010
  8. msdngroup
    Replies:
    5
    Views:
    583
    msgroup
    Jan 30, 2008
Loading...