Mostrar PopUp Window en ASP.NET

Si desea hacer un PopupWindow in ASP.NET tiene que agregar el codigo siguiente en la pantalla principal.

RegisterStartupScript("POP", " var rc = new Array(0,0); " & _
" rc = window.showModaldialog('popup.aspx','name','height=450,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes'); " & _
" if (rc != null) { if(rc[0]!=null) {document.getElementById('txt_id').innerText=rc[0]; document.getElementById('txtName').innerText=rc[1];}}" & _
"
")


En la pagina PopUp en el evento para regresar los datos debes agregar:


Response.Write(" " & _
" var uid= '" + id + "'; " & _
" var lay= '" + name + "'; " & _
" var ret=new Array( uid,lay) ; window.returnValue=ret; window.close(); " & _
"
")


Nota: Remueve la doble t de scriptt

Comments

Popular posts from this blog

Cómo identificar consultas más pesadas en SQL Server

Power View en SQL Server 2012 Primer Entrega

Machine Learning Services con SQL Server Managed Instance