Triggering an UpdatePanel using JavaScript

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.
 
M

miher

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top