如何从window.opener获取价值 [英] How to obtain value from window.opener
问题描述
我正在使用.aspx页面创建帮助"窗口.
在按钮上单击,我通过调用以下代码来打开该窗口.
Hi,
I am creating a Help window using .aspx page.
On button click i am openning that window, by calling following code.
winref = window.showModalDialog("HelpWindow.aspx?" + QueryStr, "HLP", strHelp);
打开此窗口时,我还将发送父"表单控件ID,该控件可以是文本框或标签.
该窗口由一定数量的字段组成.在选择这些任何字段时,我想将所选值确定为我的父窗体控件.
我为此使用了以下代码
while openning this window, i am also sending Parent form control id, that control can be textbox or label.
That window consist of certain number of fields. on selection of these any of fields , i want to assaign selected value to my parent form control.
i used following code for this
eval(''window.opener.document.getElementById(''CtrlName'').value="'' + AsgnText + ''"'')
但是window.opener无法找到该CtrlName或无法获取该控件.
使用window.open()方法,可以实现,但是我需要使用
But window.opener not able to find that CtrlName or not getting that control.
Using window.open() method, this can be achived but i need to perform this task using
window.showModalDialog
()
执行此任务
()
can any body suggest, what to do???
在此先感谢
thanks in advance
推荐答案
看看本文本身具有相似之处的内容: ^ ]
Have a look at this article that has something similar as a part of itself: Partial update of parent page via AJAX (ASP.NET 2.0) on close of a child window - conditionally[^]
这篇关于如何从window.opener获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!