Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:44:49+00:00 2026-06-16T04:44:49+00:00

I am trying to use the ASP.net class ClientScript to pass an array to

  • 0

I am trying to use the ASP.net class ClientScript to pass an array to my aspx page. I have succesfully completed an earlier sample to do this (code sample below). But a new routine is not working. The difference is the ClientScript class.

Error states that “routeCoords is undefined”

my java code is…

function newTest() {
    var myArray = [ , ];
    var n = 0;

    var recCount = routeCoords.length / 15;

    for (var i = 0; i < recCount ; i++) {
        for (var s = 0; s < 15; s++) {

            myArray[i, s] = routeCoords[n];
            n++;

            alert(myArray[s], [i]);
        }
    }
}

vb.net to build array and register the script….

 ' arrylist
 For p = 0 To arryLst.Count - 1
     Page.ClientScript.RegisterArrayDeclaration("routeCoords", arryLst(p))
 Next

Dim strScript As String = "newTest();"
ClientScript.RegisterStartupScript(GetType(Page), "newTest", strScript.ToString, True)

the array is correctly populating in vb.net

this is the routine from the sample that is working…

VB.net code:

For s = 0 To arryLst.Count - 1
    Page.ClientScript.RegisterArrayDeclaration("parmTypeAry", arryLst(s))
Next

JAVA code:

  // Create and Element Object of type "option"
  var opt = document.createElement("option");
  //Add the option element to the select item
  listID.options.add(opt);
  //Reading Element From Array
  opt.text = parmTypeAry[s];

which populates a dropdownlist box.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:44:51+00:00Added an answer on June 16, 2026 at 4:44 am

    Here is the solution. It required an IF condition in the for loop to check for the array.

          for (i = 0; i < recCount; i++) {
          // Array of arrays builds out each record.
              if (!myArray[i])
                  myArray[i] = []
    
              for (s = 0; s < 16; s++) {
                  //  myArray[i] = new Array(14);
    
                  myArray[i][s] = routeCoordsAry[n];
                  n++;
    
                  //  alert("i=" + i + " s=" + s + " Val: " + (myArray[i][s]));
    
              }
              // var u = 4;
              s = 0;
    
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the JsonArray class in a new empty asp.net mvc4
I'm trying to use ASP.net profiles I've followed some instructions which means I have
I'm trying to build this class (to use in ASP.NET site) that will Crop
I'm trying to use a Model with my Asp.net page. But im not using
I'm trying to use Asp.NET WebAPI module but I get a weird error. When
Getting 401 errors when trying to use ASP.NET back end in load balanced environment
Im trying to use the asp.net menucontrol but sadly without any luck. Here is
I'm trying to use the ASP.NET chart controls for a website that is localised
I am trying to use the ASP.NET Web API Self-Host option with Windows authentication
I was trying to use RoR or ASP.NET MVC but at my first impression

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.