새 부모 창 페이지 생성 :
다음 스크립트를 추가하십시오
코드 사본은 다음과 같습니다.
<html xmlns = "http://www.w3.org/1999/xhtml">
<Head Runat = "Server">
<title> 첫 </제목>
</head>
<script type = "text/javaScript">
기능 showdialog (URL)
{
var iwidth = 560; // 모달 창 너비
var iheight = 300; // 모달 창 높이
var itop = (Window.Screen.height-Height-100)/2;
var ILeft = (Window.Screen.width-iwidth)/2;
var returnValue = wind
document.getElementById ( "TextBox1"). innerText = returnValue;
}
</스크립트>
<body>
<form id = "form1"runat = "Server">
<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>
Second.html 페이지를 작성하십시오.
코드 사본은 다음과 같습니다.
<html xmlns = "http://www.w3.org/1999/xhtml">
<Head Runat = "Server">
<title> 두 번째 </제목>
<!-<베이스 대상 = "_ self"> </base>->
</head>
<script language = "javaScript">
함수 closeIg ()
{
Window.opener = null;
Window.Close ();
}
기능 OK ()
{
var value = document.getElementsByName ( "Myradio");
for (var i = 0; i <value.length; i ++)
{
if (value [i] .Checked)
{
window.returnValue = value [i] .Value;
Window.Close ();
}
또 다른
{
document.getElementById ( "lab_info"). innerText = "선택된 항목 없음, 선택하십시오!";
}
}
}
</스크립트>
<body>
<form id = "form1"runat = "Server">
<div>
<asp : datagrid id = "dgsjygl"runat = "server"allowping = "true"autogeneratecolumns = "false"
BackColor = "White"font-size = "9pt"pagesize = "5"width = "100%"height = "127px"OnitemDatabound = "dgsjygl_itemDatabound">
<PagerStyle Mode = "NumericPages" />
<AlternatingItemStyle BackColor = "Gainsboro" />
<itemstyle backcolor = "#eeeeee"forporolor = "black"horizontalalign = "center" />
<칼럼>
<ASP : TemplateColumn>
<headertemplate>
<라벨> 선택 </label>
</headertemplate>
<itemtemplate>
<입력 유형 = "radio"id = "myradio"name = "myradio"value = '< %# databinder.eval (container.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>
</열>
<headerstyle backcolor = "#7481ba"forporolor = "옐로우"font-bold = "false"font-italic = "false"font-overline = "false"font-strikeout = "false"font-underline = "false"font-size = "small" />
</asp : datagrid>
</div>
<div>
<input id = "btn_ok"type = "button"onclick = "ok ()"value = "ok"/>
<input id = "btn_cancel"type = "button"onclick = "clickdiag ()"value = "cancel" />
</div>
</form>
</body>
</html>
위는이 간단한 기능을 구현하는 것입니다. 더 편리한 방법이 있어야한다고 생각합니다. 알고 있다면 설명 할 메시지를 남겨주세요.