从弹出窗口获取值 [英] Get values back from popup window
本文介绍了从弹出窗口获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我可以打开一个弹出窗口,并在单击时将其关闭.
我有一个简单的要求,即我的弹出窗口具有一个搜索"和结果,将显示为网格",选择一个项目",然后,当我关闭弹出窗口时,在文本框中编写的值将被馈送到父窗口中的一个标签.
请帮助
Hi
I am able to open up a popup window and close it on click.
I have a simple requirement that my popup window has, a Search and result will be shown Grid,select One Item and, when I close my popup window, the value written in textbox gets fed to a lable in parent window.
Please help
推荐答案
一个简单的Google搜索就会为您提供答案.
无论如何,这是链接: ^ ]
A simple Google search would have given you the answer.
Anyways, here is the link: Google Search - get values from pop up window asp.net[^]
在javascript中使用它.
如果您在网格中使用链接按钮,则添加属性将值传递给父表单
例如:
use this in javascript.
if you are using link button in grid add attribute to pass value to parent form
Ex:
function passvalue(val)
{
Window.opener.forms[0].getelementbyid('<%=controlname%>').value = val;
}
如果您使用母版页,请使用表格[1]
在网格行数据绑定中写入以下内容
if you are using master page use forms[1]
in grid row databound write following
linkbutton lbtn = gv.rows[rowindex].cells[cellindex].findcontrol(linkbrnname);
lbtn.attributes.add("onclick","passvalue('"+ lbtn.text+"')");
检查语法.希望这行得通.
check syntax. Hope this works.
这篇关于从弹出窗口获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文