Triggering an UpdatePanel using JavaScript

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have an UpdatePanel that I want to be triggered using JavaScript. What
code do I use to make JavaScript trigger the update the same way it would
get triggered by one of the triggers created the usual way? Thanks.
 
Nathan Sokalski said:
I have an UpdatePanel that I want to be triggered using JavaScript. What
code do I use to make JavaScript trigger the update the same way it would
get triggered by one of the triggers created the usual way? Thanks.


Hi,

Assuming Your UpdatePanel is called UpdatePanel1 You can try the following
javascript :

<script type="text/javascript">
function Update() {
__doPostBack('<%= UpdatePanel1.UniqueID %>', null);
}
</script>

Call this from an eventhandler, for example :
<input type="button" value="Update" onclick="Update();" />

Hope You find this useful.
-Zsolt
 
Back
Top