asp.net script failed to execute

A

Alex D.

Hi guys. this post is related to one from last week but now I have some more
info. I am using a treeview in my app, for some reason the treeview is not
working ok in firefox-mozilla, but is working good in IE. Problem is that
the following javascript code that is inserted at the ende of my page
automatically by asp.net is not being executed or at least I beleave so
because the debugger told me that the variable "TreeView1_Data" was void or
null and obviously that is has no properties. The code:

<script type="text/javascript">
524 <!--
525 var pageUrl='/myapp/mypage.aspx;
526 WebForm_InitCallback();var TreeView1_Data = new Object();
527 TreeView1_Data.images = TreeView1_ImageArray;
528 TreeView1_Data.collapseToolTip = "Collapse {0}";
529 TreeView1_Data.expandToolTip = "Expand {0}";
530 TreeView1_Data.expandState =
theForm.elements['TreeView1_ExpandState'];
531 TreeView1_Data.selectedNodeID =
theForm.elements['TreeView1_SelectedNode'];
532 TreeView1_Data.hoverClass = 'aspnet_s8';
533 TreeView1_Data.hoverHyperLinkClass = 'aspnet_s7';
534 for (var i=0;i<19;i++) {
535 var preLoad = new Image();
536 if (TreeView1_ImageArray.length > 0)
537 preLoad.src = TreeView1_ImageArray;
538 }
539 TreeView1_Data.lastIndex = 0;
540 TreeView1_Data.populateLog =
theForm.elements['TreeView1_PopulateLog'];
541 TreeView1_Data.treeViewID = 'TreeView1';
542 TreeView1_Data.name = 'TreeView1_Data';
543
544 var WebForm_ScrollPositionSubmit = theForm.submit;
545 theForm.submit = WebForm_SaveScrollPositionSubmit;
546
547 var WebForm_ScrollPositionOnSubmit = theForm.onsubmit;
548 theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;
549
550 var WebForm_ScrollPositionLoad = window.onload;
551 window.onload = WebForm_RestoreScrollPosition;
552 // -->
553 </script>

Any ideas about why this code is never executed?
Thanks,
Alex.
 
A

Alex D.

my mistake while copying-pasting...the quotes are rendered OK

Christopher Reed said:
Are the quotes correct on line 525?
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Alex D. said:
Hi guys. this post is related to one from last week but now I have some
more info. I am using a treeview in my app, for some reason the treeview
is not working ok in firefox-mozilla, but is working good in IE. Problem
is that the following javascript code that is inserted at the ende of my
page automatically by asp.net is not being executed or at least I beleave
so because the debugger told me that the variable "TreeView1_Data" was
void or null and obviously that is has no properties. The code:

<script type="text/javascript">
524 <!--
525 var pageUrl='/myapp/mypage.aspx;
526 WebForm_InitCallback();var TreeView1_Data = new Object();
527 TreeView1_Data.images = TreeView1_ImageArray;
528 TreeView1_Data.collapseToolTip = "Collapse {0}";
529 TreeView1_Data.expandToolTip = "Expand {0}";
530 TreeView1_Data.expandState =
theForm.elements['TreeView1_ExpandState'];
531 TreeView1_Data.selectedNodeID =
theForm.elements['TreeView1_SelectedNode'];
532 TreeView1_Data.hoverClass = 'aspnet_s8';
533 TreeView1_Data.hoverHyperLinkClass = 'aspnet_s7';
534 for (var i=0;i<19;i++) {
535 var preLoad = new Image();
536 if (TreeView1_ImageArray.length > 0)
537 preLoad.src = TreeView1_ImageArray;
538 }
539 TreeView1_Data.lastIndex = 0;
540 TreeView1_Data.populateLog =
theForm.elements['TreeView1_PopulateLog'];
541 TreeView1_Data.treeViewID = 'TreeView1';
542 TreeView1_Data.name = 'TreeView1_Data';
543
544 var WebForm_ScrollPositionSubmit = theForm.submit;
545 theForm.submit = WebForm_SaveScrollPositionSubmit;
546
547 var WebForm_ScrollPositionOnSubmit = theForm.onsubmit;
548 theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;
549
550 var WebForm_ScrollPositionLoad = window.onload;
551 window.onload = WebForm_RestoreScrollPosition;
552 // -->
553 </script>

Any ideas about why this code is never executed?
Thanks,
Alex.

 
C

Christopher Reed

Okay, look at view source from the page. You'll probably see that the
client IDs in the source of your page differs from what you use in your
Javascript. If you're building this in your application, use the ClientID
property from each object used in your Javascript.

Hope this helps!
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Alex D. said:
my mistake while copying-pasting...the quotes are rendered OK

Christopher Reed said:
Are the quotes correct on line 525?
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Alex D. said:
Hi guys. this post is related to one from last week but now I have some
more info. I am using a treeview in my app, for some reason the treeview
is not working ok in firefox-mozilla, but is working good in IE. Problem
is that the following javascript code that is inserted at the ende of my
page automatically by asp.net is not being executed or at least I
beleave so because the debugger told me that the variable
"TreeView1_Data" was void or null and obviously that is has no
properties. The code:

<script type="text/javascript">
524 <!--
525 var pageUrl='/myapp/mypage.aspx;
526 WebForm_InitCallback();var TreeView1_Data = new Object();
527 TreeView1_Data.images = TreeView1_ImageArray;
528 TreeView1_Data.collapseToolTip = "Collapse {0}";
529 TreeView1_Data.expandToolTip = "Expand {0}";
530 TreeView1_Data.expandState =
theForm.elements['TreeView1_ExpandState'];
531 TreeView1_Data.selectedNodeID =
theForm.elements['TreeView1_SelectedNode'];
532 TreeView1_Data.hoverClass = 'aspnet_s8';
533 TreeView1_Data.hoverHyperLinkClass = 'aspnet_s7';
534 for (var i=0;i<19;i++) {
535 var preLoad = new Image();
536 if (TreeView1_ImageArray.length > 0)
537 preLoad.src = TreeView1_ImageArray;
538 }
539 TreeView1_Data.lastIndex = 0;
540 TreeView1_Data.populateLog =
theForm.elements['TreeView1_PopulateLog'];
541 TreeView1_Data.treeViewID = 'TreeView1';
542 TreeView1_Data.name = 'TreeView1_Data';
543
544 var WebForm_ScrollPositionSubmit = theForm.submit;
545 theForm.submit = WebForm_SaveScrollPositionSubmit;
546
547 var WebForm_ScrollPositionOnSubmit = theForm.onsubmit;
548 theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;
549
550 var WebForm_ScrollPositionLoad = window.onload;
551 window.onload = WebForm_RestoreScrollPosition;
552 // -->
553 </script>

Any ideas about why this code is never executed?
Thanks,
Alex.


 
A

Alex D.

I am sorry when you say ClientID are you talking about some element ID in my
html that differs from the ID used in the javascript? if so...how do you
know that without seen my html..and what element in specific has a wrong ID?
thanks a lot.


Christopher Reed said:
Okay, look at view source from the page. You'll probably see that the
client IDs in the source of your page differs from what you use in your
Javascript. If you're building this in your application, use the ClientID
property from each object used in your Javascript.

Hope this helps!
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Alex D. said:
my mistake while copying-pasting...the quotes are rendered OK

Christopher Reed said:
Are the quotes correct on line 525?
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Hi guys. this post is related to one from last week but now I have some
more info. I am using a treeview in my app, for some reason the
treeview is not working ok in firefox-mozilla, but is working good in
IE. Problem is that the following javascript code that is inserted at
the ende of my page automatically by asp.net is not being executed or
at least I beleave so because the debugger told me that the variable
"TreeView1_Data" was void or null and obviously that is has no
properties. The code:

<script type="text/javascript">
524 <!--
525 var pageUrl='/myapp/mypage.aspx;
526 WebForm_InitCallback();var TreeView1_Data = new Object();
527 TreeView1_Data.images = TreeView1_ImageArray;
528 TreeView1_Data.collapseToolTip = "Collapse {0}";
529 TreeView1_Data.expandToolTip = "Expand {0}";
530 TreeView1_Data.expandState =
theForm.elements['TreeView1_ExpandState'];
531 TreeView1_Data.selectedNodeID =
theForm.elements['TreeView1_SelectedNode'];
532 TreeView1_Data.hoverClass = 'aspnet_s8';
533 TreeView1_Data.hoverHyperLinkClass = 'aspnet_s7';
534 for (var i=0;i<19;i++) {
535 var preLoad = new Image();
536 if (TreeView1_ImageArray.length > 0)
537 preLoad.src = TreeView1_ImageArray;
538 }
539 TreeView1_Data.lastIndex = 0;
540 TreeView1_Data.populateLog =
theForm.elements['TreeView1_PopulateLog'];
541 TreeView1_Data.treeViewID = 'TreeView1';
542 TreeView1_Data.name = 'TreeView1_Data';
543
544 var WebForm_ScrollPositionSubmit = theForm.submit;
545 theForm.submit = WebForm_SaveScrollPositionSubmit;
546
547 var WebForm_ScrollPositionOnSubmit = theForm.onsubmit;
548 theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;
549
550 var WebForm_ScrollPositionLoad = window.onload;
551 window.onload = WebForm_RestoreScrollPosition;
552 // -->
553 </script>

Any ideas about why this code is never executed?
Thanks,
Alex.


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top