DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 31 Jul 2007 16:20:28 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    gabe
          2    Braulio Diez


AJAX call Javascript function from Update Panel Postback   
How do you call a client side javascript callback method after an
update panel has posted back to the server?

I have two update panels (A + B) with a gridview in each panel.

GridView B has a Trigger to listen when GridView A posts back from a
Select button. This works fine. I can get the Postback from GridView B
and I am able to update formatting of GridView B in it's PreRender
Event.

Gridview B has textboxes open in it's Item Template Mode. I can add an
attribute that to select the data when a user clicks on a textbox.
However, I was not able to call the Microsoft SetFocus event for a
newly added textbox when a new row was added from the RowUpdating
event in GridView A.

(this works fine)
----------------------------------------------------------------------------------------------------------
CType(gridRow.Cells(4).FindControl("txtRecipientAmount"),
TextBox).Attributes.Add("onfocus", "javascript:select();")


If I use the SetFocus method, it will work when the page posts back,
but not the Update Panel.

(this will work with a page post back, but not when the UpdatePanel
posts back)
----------------------------------------------------------------------------------------------------------------
CType(gridRow.Cells(4).FindControl("txtRecipientAmount"),
TextBox).Focus()

What I would like to do is call a javascript method on the client
after UpdatePanel B has been fired. How do I do this?

Thanks for the help,
Gabe
Date:Tue, 31 Jul 2007 16:20:28 -0000   Author:  

RE: AJAX call Javascript function from Update Panel Postback   
Hello,

  There is an event in javascript that is fired when an out of bound call is 
made (you can check if the outof bound has been made by an update panel), I'm 
using in my pages something like:

    function EndRequest (sender, args) {
       if (postBackElement.id == 
'<%Response.Write(btnSQLServerfilter.ClientID.ToString());%>')
       {              
         
$get('<%Response.Write(UpdateProgressSQL.ClientID.ToString());%>').style.display = "none";    
       }
    }


In my case btnSQLServerFilter is a button that fires my update panel.

More info:
http://weblogs.asp.net/wallym/archive/2006/11/01/UpdatePanel-Data-Transfer-and-the-beginRequest-and-endRequest-client-side-page-life-cycle-events.aspx

HTH
  Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------




"gabe" wrote:


> How do you call a client side javascript callback method after an
> update panel has posted back to the server?
> 
> I have two update panels (A + B) with a gridview in each panel.
> 
> GridView B has a Trigger to listen when GridView A posts back from a
> Select button. This works fine. I can get the Postback from GridView B
> and I am able to update formatting of GridView B in it's PreRender
> Event.
> 
> Gridview B has textboxes open in it's Item Template Mode. I can add an
> attribute that to select the data when a user clicks on a textbox.
> However, I was not able to call the Microsoft SetFocus event for a
> newly added textbox when a new row was added from the RowUpdating
> event in GridView A.
> 
> (this works fine)
> ----------------------------------------------------------------------------------------------------------
> CType(gridRow.Cells(4).FindControl("txtRecipientAmount"),
> TextBox).Attributes.Add("onfocus", "javascript:select();")
> 
> 
> If I use the SetFocus method, it will work when the page posts back,
> but not the Update Panel.
> 
> (this will work with a page post back, but not when the UpdatePanel
> posts back)
> ----------------------------------------------------------------------------------------------------------------
> CType(gridRow.Cells(4).FindControl("txtRecipientAmount"),
> TextBox).Focus()
> 
> What I would like to do is call a javascript method on the client
> after UpdatePanel B has been fired. How do I do this?
> 
> Thanks for the help,
> Gabe
> 
> 
Date:Tue, 31 Jul 2007 13:40:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us