将参数传递给弹出窗口? [英] Passing parameters to popup window?

查看:114
本文介绍了将参数传递给弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过查询字符串参数传递给一个弹出窗口(一个隐藏字段id&放大器;一个文本框ID)。然而,由于我使用的母版页编号的很长(ct100_someid)。有没有一种方法能够完美通过我的id?我可以缩短我的ID或不显示他们给用户呢?请告诉我任何交替。

I am trying to pass parameters to a popup window via query string(a hidden field id & a textbox id). However, since I am using master pages the id's are very long (ct100_someid). Is there a way to elegantly pass my ids ?Can I shorten my id's or not show them to the user at all ? Please tell me any alternates.

推荐答案

您可以定义可以通过弹出窗口访问设置fiedls值父页面上的功能:

you can define function on parent page which can be accessed by popup window to set values of fiedls:

在父页

function setHiddenValues(a,b,c){
    document.getElementById("<%= hiddenField1.ClientID%>").value = a;
    document.getElementById("<%= hiddenField2.ClientID%>").value = b;
    document.getElementById("<%= hiddenField3.ClientID%>").value = c;
}

在弹出页面中,用户选择后的行:

On popup page, after user selects row:

parent.setHiddenValues(val1, val2, val3);

这篇关于将参数传递给弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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