Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update an UpdatePanel from JavaScript

Given an Asp.Net page that contains UpdatePanels. How to update a specific UpdatePanel from the client-side.

And is it possible to update it from a dialog opened from this page? (via window.open)

Thanks in advance.

like image 642
Mahdi Avatar asked May 01 '11 06:05

Mahdi


People also ask

How does UpdatePanel work in asp net?

UpdatePanel controls are a central part of AJAX functionality in ASP.NET. They are used with the ScriptManager control to enable partial-page rendering. Partial-page rendering reduces the need for synchronous postbacks and complete page updates when only part of the page has to be updated.

Can we use multiple UpdatePanel in asp net?

By using multiple UpdatePanel controls on a page, you can incrementally update regions of the page separately or together. For more information about partial-page updates, see Partial-Page Rendering Overview and Introduction to the UpdatePanel Control.


2 Answers

Here are some links to take a look at...

Easily refresh an UpdatePanel, using JavaScript

How to refresh an UpdatePanel from javascript

Refresh the UpdatePanel using JavaScript Code

like image 178
Muhammad Akhtar Avatar answered Sep 26 '22 01:09

Muhammad Akhtar


Update Updatepanel with JS

<script type="text/javascript"> 
function UpdPanelUpdate(value)
{
   var obj = document.getElementById("<%= txt.ClientID %>");
   obj.value=value;
   __doPostBack("<%= btn.ClientID %>","");
}
</script>
like image 39
Govind Malviya Avatar answered Sep 23 '22 01:09

Govind Malviya