Asp.Net Execute Javascript in an Update Panel


i want to execute Javascript in an Update Panel.

<update panel 1 />
<update panel 2 />

if the panel 2 sends an callback, some javascript should be shown.

i'm using
best regards
Who is Participating?
David RobitailleConnect With a Mentor Analyst ProgrammerCommented:
I dont know if you have many trigger to the update panel 2, but you could use something like on this one.
the intersting part is there :
<script type="text/javascript">
function(sender, e)
if (e.get_postBackElement().id == "<%= GridView1.ClientID %>") // This line can make sure only the request from GridView1 will present popup panel, you can change it to other control client id.

it run a script at each postback and it check the postBackElement().id to show the popup. so you could replace the $find('modalbehavior').show(); with your script and "<%= GridView1.ClientID %>")  with all the control that trigger the update (The all the control part may be a problem to you...  )
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.