Tema: Pop up
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/11/2009, 12:05
skel363
 
Fecha de Ingreso: febrero-2003
Ubicación: chile
Mensajes: 101
Antigüedad: 21 años, 2 meses
Puntos: 1
Respuesta: Pop up

para abrir un popup puedes hacer lo siguiente

tu boton
Código:
<asp:Button id="btn" runat="server" OnClientClick="Search();" />
Luego en la misma página html creas tu funcion javascript
Código:
function Search()
{
    var data = document.getElementById("hdn");
    response = window.showModalDialog("../TuPagina2.aspx", null, "dialogHeight:540px;dialogWidth:800px;status:no;scroll:no;resizable:no;help:no;");
    if(response !=null)
    {
        data.value = response;
    }
    
}
Donde hdn es un HiddenField

Código:
<asp:HiddenField ID="hdn" runat="server" />
Todo lo anterior es en la página principal donde vas a llamar a tu popup, ahora en el popup para enviar datos de respuesta en el metodo o evento donde capturas los datos que quieres enviar al Formulario 1 debes agregar este codigo

Código:
string strOutput = "<script>window.returnValue = '" + AQUI EL VALOR QUE QUIERES ENVIAR + "'; window.close();</script>";
Response.Write(strOutput);
Ahora para capturar el valor en el FORM 1 agregas una funcion en el Page_Load

Código:
 protected void Page_Load(object sender, EventArgs e)
        {
            HideMessageWindows();

            if (!IsPostBack)
            {
               
            }

            if (!string.IsNullOrEmpty(hdn.Value))
                Funcion(hdn.Value);
        }

private void Funcion(string vchValue)
{
    //AQUI LO QUE QUIERAS HACER CON EL VALOR ENVIADO DESDE EL POPUP
}
Esta es una de las muchas formas de hacer lo que necesitas.... Saludos
__________________
s[K]eL