Solved

Out of memory at line:

Posted on 2008-10-06
15
3,586 Views
Last Modified: 2011-10-19
I have an asp.net web form with a basic drop listbox which updates a multi-select list-item box based on the selected option.  It worked fine in the initial page that I setup, but now when I copy and paste all of the code to another page, then try to select an option from the drop list, I get the error: "Out of memory at line: 139".

Both listbox/items are databound to my mssql dB and are inside an update panel.

Any suggestions?

Thanks to all the experts in advance.
0
Comment
Question by:reignsupreme
  • 7
  • 5
  • 3
15 Comments
 
LVL 16

Expert Comment

by:burakiewicz
ID: 22652686
did you make any changes to the collections you use.   you can get this error if the collection ie List is too large
0
 

Author Comment

by:reignsupreme
ID: 22652964
No, all I did was a full copy and paste of the entire code.  It doesn't make any sense to me what is different between the 2 pages other than the page name.
0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 22653046
what is the code at 139?
0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 22653054
also, did any more items get added into the db?
0
 

Author Comment

by:reignsupreme
ID: 22653140
The line is not really accurate. I have removed some lines of code and it still always says 139.  
No, nothing new has been added to the dB.  To reiterate, it works fine in the first page I created last week, but I need the functionality replicated in some other pages that have different interfaces.

Now even when I copy the exact code to a new page the error occurs.  Very strange.
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22660960
Mind posting your code here?
0
 

Author Comment

by:reignsupreme
ID: 22661208
OK, since the page contains a lot of fields and code, I tried to post just the code relevant to the question:

<form runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

       </asp:ScriptManager>

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">

                                    <ContentTemplate>

                                        <asp:ListBox ID="listThera" runat="server" DataSourceID="dsTheraAreas" DataTextField="TA_NAME"

                                    DataValueField="TA_NUMBER" Width="382px" Rows="1" AppendDataBoundItems="True" AutoPostBack="True">

                                <asp:ListItem Value="0">Please Select...</asp:ListItem>

                            </asp:ListBox>

                                        <asp:ListBox ID="ListTA_SUB_1" runat="server" DataSourceID="dsSubTA_1" DataTextField="TA_SUB_NAME" DataValueField="TA_SUB_ID" Height="167px" Width="382px" SelectionMode="Multiple">

                                        </asp:ListBox>

                                    </ContentTemplate>

                                </asp:UpdatePanel>

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:prairiedog
ID: 22661373
>>>The line is not really accurate. I have removed some lines of code and it still always says 139.  

It is not refering your own code. It was likely caused by AJAX. Maybe you have a circular call that caused an infinite loop? Try lauching your application in FireFox to see if you get any JavaScript error.
0
 

Author Comment

by:reignsupreme
ID: 22661387
OH so you were able to get the same error?
I tried it in firefox, no error, but the data does not diplay in the 2nd box.
0
 
LVL 22

Accepted Solution

by:
prairiedog earned 500 total points
ID: 22661454
>>>OH so you were able to get the same error?
I never had this problem before, but it seems like something crashed IE.

Open JavaScript console in FireFox to see if there is any JS error. At the right upper corner of FireFox, there is an icon for JavaScript console.

2008-10-07-121537.jpg
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22661513
One more thing, when you copy & paste the code to another page, do the two pages in the same application? Make sure the "Inherits" in the Page directive is pointing to the right file.
0
 

Author Comment

by:reignsupreme
ID: 22661685
I have FF 3.0.3 and do not see the JavaScript console below the Google toolbar however I found an "error console" under the "Tools" menu.

The "inherits" page directive is pointing to the right file thanks.


file1.bmp
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22661726
One thing you can try now: remove the UpdatePanel and do full postback to see if the problem still exists.
0
 

Author Comment

by:reignsupreme
ID: 22661934
prairiedog, I think I may have found the problem.  Thanks for suggesting that I use FF's error console.  I found this in the new page's form element: onsubmit="javascript:return WebForm_OnSubmit();".   It was causing the rendered page to add the script below. The original page I developed did that contain that.  But the graphic designers took my original page and must've added it later.

Once I removed it, the AJAX section started working as it should.  

Thanks for your assistance.
<script type="text/javascript">

//<![CDATA[

function WebForm_OnSubmit() {

if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;

return true;

}

//]]>

</script>

Open in new window

0
 

Author Closing Comment

by:reignsupreme
ID: 31503945
Thank you, your suggestion eventually led me to look more at the javascript in the page itself and not necessarilly at the AJAX section.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now