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 693405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:45:02+00:00 2026-05-14T02:45:02+00:00

Ran into an Out of Stack Space error trying to serialize an ASP.Net AJAX

  • 0

Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object.

Here is the scenario with simplified code:

  1. Default.aspx

  2. MainScript.js

    function getObject(){
        return new Array();
    }
    
    function function1(obj){
        var s=Sys.Serialization.JavaScriptSerializer.serialize(obj);
        alert(s);
    }
    
    function function2(){
        var obj=getObject();
        var s=Sys.Serialization.JavaScriptSerializer.serialize(obj);
        alert(s);
    }
    
  3. Content.aspx

  4. ContentScript.js

    function serializeObject(){
        var obj=window.top.getObject();
        window.top.function1(obj); // <– This works fine
    
        obj=new Array();
        window.top.function1(obj); // <– this causes an Out of Stack Space error
    }
    

The code for the sample pages and JavaScript is here.

Posting the code for the aspx pages here posed a problem. So please check the above link to see the code for the aspx pages.

A web page (default.aspx) with an IFrame on that hosts a content page (content.aspx).

Clicking the “Serialize Object” button calls the JavaScript function serializeObject(). The serialization works fine for Array objects created in the top window (outside the frame). However if the array object is created in the IFrame, serialization bombs with an out of stack space error. I stepped through ASP.Net AJAX JS files and what I discovered is, the process goes into an endless loop trying to figure out the type of the array object. Endless call to Number.IsInstanceOf and pretty soon you get an out of stack error.

Any ideas?

  • 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-05-14T02:45:02+00:00Added an answer on May 14, 2026 at 2:45 am

    This problem happens because Sys.Serialization.JavaScriptSerializer can’t serialize objects from others frames, but only those objects which where instantiated in the current window (which calls serialize() method). The only workaround which is known for me it’s making clone of the object from other frame before calling serialize() method.

    Example of the clone() methode you can find here (comments in Russian):
    link text

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying out an experimental UINavigationController-based iPhone application, I ran into a problem when
Ran into this error message while trying to select some records off a table.
I am trying out the Camera API for Phonegap and I have ran into
I'm starting with ember.js and ran into trouble trying out things in the ember.js
I ran into a scenario where I had a delegate callback which could occur
I ran into an interesting problem. On my site, i swap out content dynamically
I ran into a real head scratcher recently while trying to debug an issue
I ran into a bug in Firefox involving some out-of-sync information on my form
Wondering if anyone out there has ran into this before.... I'd like to use
Ran into something interesting, want to know if I'm doing something wrong or if

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.