现在的位置: 首页 > 综合 > 正文

Asp.net弹出新窗口,获得返回值

2012年12月01日 ⁄ 综合 ⁄ 共 660字 ⁄ 字号 评论关闭

Page.aspx 写法:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page.aspx.cs" Inherits="_Page" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Asp.net弹出新窗口,获得返回值</title>
    <script type="text/javascript" >
    function Pop()
    {      
        var result=showModalDialog('downs.aspx','subpage','dialogWidth:400px;dialogHeight:300px;center:yes;help:no;resizable:no;status:no'); //打开模态子窗体,并获取返回值
        document.getElementById("txt_id").value=result.split("|&|")[0]; //返回值分别赋值给相关文本框
        document.getElementById("txt_name").value=result.split("|&|")[1];
        document.getElementById("txt_pwd").value=result.split("|&|")[2];
    }
    </script>

抱歉!评论已关闭.