子視窗
son.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
_employee = new Employee_ConnectDB();

btnSurvey.OnClientClick = string.Format("GetInfo(); return false;");
}

son.aspx
"<>包住 script type="text/javascript"
function GetInfo()
{
var parWin = window.opener;
parWin.document.getElementById("txtEmployeeID").value = str1;
parWin.document.getElementById("txtFirstName").value = str2;

// call parent function
//window.opener.DoSearch(window.document.getElementById('txtEmployeeID').value, window.document.getElementById('txtFirstName').value, window.document.getElementById('txtLastName').value);
window.close();
}
<>包住 /script

父視窗
parent.aspx

<>包住 script type="text/javascript"
function CallDialog()
{
window.open('ListEmployee.aspx', 'search', 'height=600,width=400,status=yes');
//window.showModalDialog("ListEmployee.aspx",window,"status:false;dialogWidth:300px;dialogHeight:300px;dialogLeft:50px;dialogTop:200px");
}
function DoSearch(str1, str2, str3)
{
var btn = window.document.getElementById('ctl00_ContentPlaceHolder_btnSearch');
// Label
//window.document.getElementById('ctl00_ContentPlaceHolder_lblStates').innerHTML = str1 + ',' + str2 + ',' + str3;
btn.value = str1 + ',' + str2 + ',' + str3;
btn.click();
}
<>包住 /script
...
...

<>包住 asp:ImageButton ID="imgbtnSearch" runat="server" ImageUrl="~/img/cal.JPG" OnClientClick='CallDialog();' /
arrow
arrow
    全站熱搜

    JohnDX 發表在 痞客邦 留言(0) 人氣()