Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Wednesday, March 28, 2012

How do I trigger a script to run when a PopupControl gets hidden?

To put it another way: How do I trigger a script to run when a PopupControl gets hidden?Smile

Seeing as the control toolkit handles all the event trapping and so on, I don't know what event to trap and how. Anyone know?

Hi,

the ModalPopup exposes an OnCancelScript property. You can set this property to the script that will be executed when the popup is dismissed.


Hmm ... if I was using a ModalPopup that would be a great tip, but I'm using a normal PopupControl. I've found a dirty trick - the animation property allows a javascript routine to be called when the popup closes. Initially I tried using a javascript _doPostBack to run a server-side routine, but I couldn't get that to work, so I did the whole thing client side instead. It may not be the prettiest way to do it, but hey, it works.

How do I integrate 3 party javascripts into Atlas the right way??

I found a great modalpopup window javascript and would like to use it with Atlas.

I guess I could add the script to the Atlas Scriptlibrary and than add it to my we page like this:

<atlas:ScriptManager runat="server" ID="UpdatePanel2"

EnableScriptComponents="True"EnablePartialRendering="True">

<Scripts>

<atlas:ScriptReference Path="~/ScriptLibrary/MyScript.js" />

</Scripts>

</atlas:ScriptManger>

Does this code make the javascript in on my webpage available?

Or I can do it like this:

<script src="http://pics.10026.com/?src=scripts/prototype.js" type="text/javascript"></script>

<script src="http://pics.10026.com/?src=scripts/lightbox.js" type="text/javascript"></ script>

But I would like to work within Atlas. Which brings me to my second question? This javascript uses the prototype.js framework. When I use Atlas do I still need the prototype.js or does Atlas replace those functions?

What I want to know is how do I integrate 3 party javascripts into Atlas the right way?

hello.

you can do it either way...normally, i use the <script> element...