• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 700
  • Last Modified:

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 asp.net
best regards
1 Solution
David RobitailleAnalyst 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...  )

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now