Cree una nueva página de ventana principal:
Agregar el siguiente script
La copia del código es la siguiente:
<html xmlns = "http://www.w3.org/1999/xhtml">
<head runat = "servidor">
<title> First </title>
</ablo>
<script type = "text/javaScript">
función showdialog (URL)
{
var iWidth = 560; // ancho de ventana modal
var iHeight = 300; // Altura de la ventana modal
var iTop = (Window.screen.Height-iHeight-100)/2;
var ileft = (window.screen.width-iwidth)/2;
var returnValue = window.showModalDialog (url, "newWindow", "dialogHeight:"+iHeight+"px; dialogwidth:"+iwidth+"px; barra de herramientas: no; menuBar: no; scrollbars: no; residable: no; ubicación: no; estatus: no; izquierda: 200px; top: 100px;")
document.getElementById ("TextBox1"). Innertext = returnValue;
}
</script>
<Body>
<Form ID = "form1" runat = "servidor">
<input id = "button1" type = "button" value = "button" onClick = "showDialog ('./ Second.aspx')" />
<Div> <Asp: textbox id = "textbox1" runat = "server" width = "67px"> </asp: textbox> </div>
</form>
</body>
</html>
Crear una página segunda.html:
La copia del código es la siguiente:
<html xmlns = "http://www.w3.org/1999/xhtml">
<head runat = "servidor">
<title> segundo </title>
<
</ablo>
<script language = "javaScript">
Función CLOWIAG ()
{
Window.opener = nulo;
window.close ();
}
función ok ()
{
value var = document.getElementsByName ("myradio");
para (var i = 0; i <value.length; i ++)
{
if (valor [i] .cecked)
{
Window.ReturnValue = valor [i] .Value;
window.close ();
}
demás
{
document.getElementById ("Lab_info"). Innertext = "Sin elemento seleccionado, por favor seleccione!";
}
}
}
</script>
<Body>
<Form ID = "form1" runat = "servidor">
<div>
<ASP: DataGrid ID = "DGSJYGL" Runat = "Server" iLodpaging = "True" AutogenerAteColumns = "Falso"
Backcolor = "White" font-size = "9pt" PageSize = "5" Width = "100%" Height = "127px" onItemDatabound = "dgsjygl_itemdataBound">
<Pagerstyle mode = "numericPages" />
<AlternoTemstyle backColor = "Gainsboro" />
<ItemStyle backColor = "#eeeeee" pronexor = "negro" horizontalalign = "centro" />
<CoLoLums>
<ASP: TemplateColumn>
<HeaderTemplate>
<Label> Seleccionar </selebel>
</HeaderTemplate>
<ItemTemplate>
<input type = "radio" id = "myradio" name = "myradio" valor = '< %# databinder.eval (contenedor.dataitem, "id") %>'>
</Itemtemplate>
<HeaderStyle font-bold = "true" horizontalalign = "center" width = "60px" />
<ItemStyle horizontalalign = "Center" />
</ASP: TemplateColumn>
<ASP: BoundColumn DataField = "ID" Headertext = "No".
<Headerstyle Font-Bold = "True" Width = "75px" horizontalalign = "Center"/>
</ASP: BoundColumn>
<ASP: BoundColumn DataField = "MC" Headertext = "Name">
<HeaderStyle Font-Bold = "True" Width = "90px" horizontalalign = "Center"/>
<ItemStyle horizontalalign = "Center" />
</ASP: BoundColumn>
<ASP: BoundColumn DataField = "BT" Headertext = "Title">
<Headerstyle Font-Bold = "True" horizontalalign = "Center"/>
</ASP: BoundColumn>
</Columnas>
<HeaderStyle BackColor = "#7481BA" ForeColor = "Yellow" Font-bold = "false" font-italic = "false" font-overline = "false" font-strikeout = "false" font-subline = "false" font-size = "pequeño" />>>
</ASP: DataGrid>
</div>
<div>
<input id = "btn_ok" type = "button" onClick = "ok ()" value = "ok"/>
<input id = "btn_cancel" type = "button" onClick = "clickdiag ()" valor = "cancelar" />
</div>
</form>
</body>
</html>
Lo anterior se trata de implementar esta función simple. Siento que debería haber una manera más conveniente. Si lo sabe, deje un mensaje para explicar.