Hello,
Take a look at InitializeRequest and EndRequest (on end request you can
check which update panel triggered the petition and then run your
javascript):
http://asp.net/ajax/documentation/l...PageRequestManagerInitializeRequestEvent.aspx
A sample code (this one is used to show and hid progress indicators when
they are associated to a panel ID, ** bug on AJAX**):
<script type="text/javascript">
// Well... UpdateProgress only works fine with triggers if it's not
associated to a single update panel
// to make it work with a single panel (like the case we have in this
case), we need to make a hack
// intercept the call, check the control name (response.write needed
from server because of the nasty
// ctl_00 prefix added to the control), and then show the progress
indicator associated to that control
// very ugly stuff, but we only will need it if we have two update
panles and two progress indicators.
//
http://geeks.ms/blogs/sergiotarrillo/archive/2007/05/06/14266.aspx
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
var postBackElement;
function InitializeRequest(sender, args) {
if (prm.get_isInAsyncPostBack())
{
args.set_cancel(true);
}
postBackElement = args.get_postBackElement();
// Dotnet panel
if (postBackElement.id ==
'<%Response.Write(btdotnetSearchFilter.ClientID.ToString());%>')
{
$get('<%Response.Write(UpdateProgressNet.ClientID.ToString());%>').style.display
= "block";
}
// SQL Server Panel
if (postBackElement.id ==
'<%Response.Write(btnSQLServerfilter.ClientID.ToString());%>')
{
$get('<%Response.Write(UpdateProgressSQL.ClientID.ToString());%>').style.display
= "block";
}
}
function EndRequest (sender, args) {
if (postBackElement.id ==
'<%Response.Write(btnSQLServerfilter.ClientID.ToString());%>')
{
$get('<%Response.Write(UpdateProgressSQL.ClientID.ToString());%>').style.display
= "none";
}
}
function AbortPostBack() {
if (prm.get_isInAsyncPostBack()) {
prm.abortPostBack();
}
}
</script>
Good luck
Braulio
/// ------------------------------
/// Braulio Diez
///
///
http://www.tipsdotnet.com
/// ------------------------------