Welcome Guest Search | Active Topics | Sign In | Register

Updatepanel and ScriptManager.RegisterStartupScript Options
FCruz
Posted: Tuesday, July 13, 2010 2:14:46 PM
Rank: Member
Groups: Member

Joined: 6/4/2010
Posts: 16
Hi,

I have a CallbackPanel in a page and in a procedure I've the next code,

Code: Visual Basic.NET
sUrl.AppendFormat("window.open('")
                    sUrl.AppendFormat("./su_BuscaPersona.aspx?")
                    sUrl.AppendFormat("Nom={0}&Bandera=1&cveId={1}", Me.txtNom.Text, txtCve.ClientID)
                    sUrl.AppendFormat("&nomId={0}&rfcId={1}", txtNom.ClientID, txtRFC.ClientID)
                    sUrl.AppendFormat("&rdbCveId={0}", rdbCve.ClientID)
                    'sUrl.AppendFormat("&strBoton={0}", cmdBuscar.ClientID)
                    sUrl.AppendFormat("&strBoton={0}", Me.ibtnBuscar.ClientID)
                    sUrl.AppendFormat("', 'BusquedaPersona', 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=900,height=400,left=100,top=100');")
                    ScriptManager.RegisterStartupScript(Me, GetType(Button), "AbrePopup", sUrl.ToString, True)



The page "su_BuscaPersona.aspx" don't appears and I need to see it because in the page "su_BuscaPersona.aspx" exist a function that return any values to parent page but it not work, without the callbackpanel it works.

Any idea or example ?

Thanks in advance.
eo_support
Posted: Tuesday, July 13, 2010 2:20:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will have to use UpdatePanel for that. CallbackPanel does not support RegisterStartupScript.

Thanks!
FCruz
Posted: Friday, July 16, 2010 12:37:07 PM
Rank: Member
Groups: Member

Joined: 6/4/2010
Posts: 16
I've resolved this issue using the property ClientSideAfterUpdate.

Example:
My callback.
Code: HTML/ASPX
<eo:Callbackpanel 
                    runat="server" 
                    ID="cbData" 
                    GroupName="Data" 
                     LoadingDialogID="dlgBlock"
                    
                   ClientSideAfterUpdate="cbData_back">


My script:
Code: JavaScript
function cbData_back()
        {
            var hdnMsg;
            var sCadena;
            
            hdnMsg=recuperaElemento('hidden','hdnErrorMsg');
            
            if (hdnMsg.value != '') {
                alert(hdnMsg.value);
		        hdnMsg.value = '';
		    }		    
		    
		    sCadena = document.getElementbyId('hdnOpenWindow');
                
            if (sCadena.value != ''){
                
                openWindow(sCadena);
            }
        }
        
        function openWindow(sCadena)
        {   
            var sUrl;
            sUrl = sCadena.value.split('|');
            var obj = window.open(sUrl[1],'BuscarCliente','toolbar=no,location=no,directories=no,status=no,resizable=no,width=900,height=400,left=100,top=100');
        }


Code: Visual Basic.NET
sUrl.AppendFormat("./su_FindCustomer.aspx?")
 sUrl.AppendFormat("Nom={0}&Bandera=1&cveId={1}", Me.txtNom.Text, txtCve.ClientID)
 sUrl.AppendFormat("&nomId={0}&rfcId={1}", txtNom.ClientID, txtRFC.ClientID)
 sUrl.AppendFormat("&rdbCveId={0}", rdbCve.ClientID)
 sUrl.AppendFormat("&strBoton={0}", Me.ibtnBuscar.ClientID)

 Me.hdnOpenWindow.Value = "1|" & sUrl.ToString


I hope this help you.
eo_support
Posted: Friday, July 16, 2010 12:38:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes. This will work. Thanks for sharing!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.