将值从子级传递到父级页面 [英] pass value from child to parent page
问题描述
谁能告诉我如何将值从子页面传递到父页面.我在父页面上有一个gridview.在gridview中有一个文本框.在子页面中,我有一个文本框和一个按钮.现在,我希望在子页面的文本框中输入一个值并单击按钮时,则需要在父页面的gridview内的文本框中显示该值.我正在使用C#
在此先感谢
Can anyone tell me how to pass value from child page to parent page.I have a gridview on a parent page.Inside a gridview i have a textbox. In child page i have a textbox and a button. Now i want that when a value is entered in textbox in child page and button is clicked then this value needs to be shown in the textbox inside gridview in parent page. I am using C#
Thanks in advance
推荐答案
在您的父页面中,声明一个回调函数:
In your Parent page, declare a a callback function:
function HandlePopupResult(result) {
// Do what you want here
}
在您的子页面中,声明一个函数:
In your Child page, declare a function:
function SendValue(somevalues) {
// Your logic here
window.opener.HandlePopupResult(somevalues);
}
只需在按钮单击事件上使用功能SendValue.
祝您编码愉快!
Just use the function SendValue on your button click event.
Happy coding!
这篇关于将值从子级传递到父级页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!