Showing posts with label loads. Show all posts
Showing posts with label loads. Show all posts

Wednesday, March 28, 2012

How do I know the load?

I have my web pages that are using web services via atlas technology. when page loads users can click on the links but get error because page has not been loaded yet. How do I know that page loaded on atlas? How do I know that procies are created? can someone provide me some working javascript or what ever is possible to detect it?

thanks and greately appreaciated

Hi,

just hook up the load event raised by the global Sys.Application instance. Here's the code to add to your page:

<script type="text/javascript">
<!--
function onLoad() {
// Put your Atlas stuff here.
}
//-->
</script>
<script type="text/xml-script">
<page>
<components>
<application load="onLoad" />
</components>
</page>
</script>

The above code will call the onLoad function (it's a javascript function that you have to define) when all the framework stuff is initialized.

Monday, March 26, 2012

How do I execute JS on page load after postback within an update panel?

I am trying to scroll the page after it loads between postbacks within an Update Panel. I used to have this work with beta 1

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<application load="onAutoScrollControlLoad" />
</components>
</page>
</script>

I am not sure how I came up with this, but it doesn't work with Beta 2 any more. Any ideas of how to implement the same functionality?

Thx
dB.

found a solution for this -http://forums.asp.net/thread/1418207.aspx

<scripttype="text/javascript">
function onAutoScrollControlLoad() { window.location.href ='#<% Response.Write(ScrollLocation); %>'; }
Sys.Application.add_load(function() { onAutoScrollControlLoad(); });
</script>