Write out Javscript Array from C#

Discussion in 'ASP .Net' started by =?Utf-8?B?Qw==?=, Apr 23, 2007.

  1. In my C# code I have a collection of values.

    I want these values to be available to my clientside Javascript.

    How can I do this?

    Write to a hidden field?
     
    =?Utf-8?B?Qw==?=, Apr 23, 2007
    #1
    1. Advertising

  2. Hello C,

    Use client script manager - RegisterClientScriptBlock methods.
    See MSDN for more details and samples

    ---
    WBR, Michael Nemtsev [.NET/C# MVP].
    My blog: http://spaces.live.com/laflour
    Team blog: http://devkids.blogspot.com/

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo

    C> In my C# code I have a collection of values.
    C>
    C> I want these values to be available to my clientside Javascript.
    C>
    C> How can I do this?
    C>
    C> Write to a hidden field?
    C>
     
    Michael Nemtsev, Apr 23, 2007
    #2
    1. Advertising

  3. Yes, this is a good idea.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "C" <> wrote in message
    news:...
    > In my C# code I have a collection of values.
    >
    > I want these values to be available to my clientside Javascript.
    >
    > How can I do this?
    >
    > Write to a hidden field?
     
    Eliyahu Goldin, Apr 23, 2007
    #3
    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. Mike

    NavigateUrl and Javscript

    Mike, Jul 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    392
    Martin Honnen
    Jul 17, 2004
  2. Darrel
    Replies:
    4
    Views:
    2,270
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Oct 26, 2004
  3. Benton
    Replies:
    4
    Views:
    1,123
    Mr Newbie
    Nov 26, 2005
  4. NUG-IT
    Replies:
    11
    Views:
    2,001
  5. RSH
    Replies:
    6
    Views:
    8,484
Loading...

Share This Page