我在一个窗口中打开一个模式对话框,然后在模式对话框中的文本框中输入一段话,然后点击确定返回父窗口,请问我怎么才能在父窗口中得到那段话呢?
解决方案 »
- 哪个达人给讲下FCL中System.collections 和System.IO.Stream的设计机制?叩谢八辈祖宗
- 讨论!即时通讯服务器负载平衡的问题,有难度,不管水平如何一起讨论。发贴就有分。谢谢大家踊跃发言。
- 求,这个程序怎么写
- 请教一个winfrom下dll调试的问题,谢谢
- 会js的教小弟一下,看看下面的代码输出什么?
- 我写既C#代码好奇怪啊?想请各位看看!
- 在Asp.Net中如何手工合并DataGrid行或列?急!在线等!!
- 字符串的菜鸟问题,望大哥门帮忙
- win7下安装sql2005出现的兼容性问题
- 我是初学C#请问C#里面如何连接数据怎么连接
- 问问各位,获取摄像头的程序和获取视频采集卡的程序是不是一样的?
- 如何调整asp.net2.0的页面控件布局
function rtvalue()
{
top.returnValue="要返回的字符串";
top.close();
}
父页面接受
<script language=javascript>
function test()
{
var r=window.showModalDialog("a.aspx",'','');
document.getElementById('<%=TextBox1.ClientID%>').value=r;
}
</script>
string content=dialog.textboxContent.Text;
可能编不过去
父窗体
private string m_strText; //用来储存返回的String
Public void SetText(string strText)
{
this.m_strText=strText;
}
private void OpenChildWindow()
{
frmChild frm=new frmChild();
frm.ShowDialog();
this.strText=frm.GetText();
}子窗体:
private string strText; //用来存储你要的字符串
public string GetText()
{
Return strText;
}
你看看能用不?
frmChild frm=new frmChild();
frm.ShowDialog();
string s = frm.publicvariable;