由于回发而丢失从父页面上的子页面设置的值 [英] losing values set from child page on parent page due to postback

查看:78
本文介绍了由于回发而丢失从父页面上的子页面设置的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在父页面中点击按钮时打开一个弹出窗口[i-frame]。在弹出页面中完成操作后,我将从弹出页面设置父页面中的值。我可以访问父页面的元素,我正在设置元素中的值。但是回发后我的价值就会丢失。



这是我在子页面或iframe内的弹出页面中使用的代码。

Hello,
I am opening a popup [i-frame] on button click in the Parent page. After i have done the operations in the popup page i am setting the values in parent page from the popup page. I can access the elements of the parent page and i am setting the values in the elements. however post back occurs and my values are lost.

this is the code that i am using in the child page or the pop up page which is inside a iframe.

$('input[id*="MyId"]:first', window.parent.document).val($('#<%= MyValue.ClientId%>').val());
$('input[id*="txtDesc"]:first', window.parent.document).val('hello');







任何建议如何保留值?




any suggestions how can i keep the values ??

推荐答案

('input [id * = MyId]:first',window.parent.document).val(
('input[id*="MyId"]:first', window.parent.document).val(


('#<%= MyValue.ClientId%>')。val());
('#<%= MyValue.ClientId%>').val());


('input [id * =txtDesc]:first',window.parent.document).val('hello');
('input[id*="txtDesc"]:first', window.parent.document).val('hello');







任何建议如何保持价值?




any suggestions how can i keep the values ??


这篇关于由于回发而丢失从父页面上的子页面设置的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆