-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: loveablerahuls
Message 3 in Discussion

Thanks Rohit,



----- Original Message -----
From: Rohit_BD <[EMAIL PROTECTED]>
Date: Wed, 8 Sep 2004 03:10:08 -0700
Subject: Re: Javascript Array Variable
To: MumbaiUserGroup <[EMAIL PROTECTED]>


New Message on MumbaiUserGroup


Javascript Array Variable


Reply

 Reply to Sender   Recommend Message 2 in Discussion 

From: Rohit_BD 


You have not specified which server-side platform you are using. I
will assume ASP.NET with C#
 
To create an array on client-side via serve-side code, you simply need
to write out the JavaScript code as if it is HTML content.
 
C# server-side code (code-behind):
 

private void CreateClientSideVariables()

{

    Response.Write("<script>\n");

 

    //Write out array declaration & initialisation

    Response.Write("var myArray = new Array();\n"); 

    Response.Write("var myArray2D = new Array();\n\n"); 

 

    //Write out array contents for 1st array

    Response.Write("myArray[0] = 0\n"); 

    Response.Write("myArray[1] = 1\n\n");

    

    //Write out array contents for 2nd array

    Response.Write("myArray2D[0] = myArray;\n");

    Response.Write("</script>\n");

}
 
When this method is called in code-behind, this is what will be
emitted to the browser:

<script>

var myArray = new Array();

var myArray2D = new Array();

 

myArray[0] = 0;

myArray[1] = 1;

 

myArray2D = myArray;

</script>
 
<html>
<head>
......
View other groups in this category. 



Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating |
Daily Horoscopes





To stop getting this e-mail, or change how often it arrives, go to
your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport
Member Services.
For other questions or feedback, go to our Contact Us page. 

If you do not want to receive future e-mail from this MSN group, or if
you received this message by mistake, please click the "Remove" link
below. On the pre-addressed e-mail message that opens, simply click
"Send". Your e-mail address will be deleted from this group's mailing
list.
Remove my e-mail address from MumbaiUserGroup. 



-- 
Everythig that your Mind Concieve and your Heart Believe, You can Achieve


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to