子窗体是作为新开的弹出式窗体,操作完成后希望将该新窗体关闭,并回到原来的窗体上并更新原来页面上的信息,请教一下,应该怎么操作?
解决方案 »
- vs安装问题
- 如何在用户单击BindingNavigator上的删除按钮时弹出确认对话框?
- c# 生成CHM电子书时, 文件名有“#”的打不开?请问这么解决?谢谢
- 请问如何将String转换为Hex String?
- 这样的
- 控制台程序如何得到文件路径?
- 如何用代码设定用户和角色的权限?(200分)
- sql server 什么时候使用 sql_variant , timestamp , uniqueidentifier 类型?
- 请问各位,一般你们较大软件(应该叫系统吧)的测试周期占整个周期(系统100%完成)的多少啊?编码占周期的多少呢?
- 新手请教
- DOS指令中,如果文件夹名称有空格怎么办?顶贴有分!
- 在c#中,怎么能把pdf中的内容,读出到DataSet里面?
Response.Write("<script>window.open('aaa.aspx','www','height=200,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');</script>");
opener.location.reload();
this.close();
关键是,你在父窗体中读取的时候一定要把代码段放在 子窗体.ShowDialog();之后。
window.opener.location.reload(); //或refresh()
window.close();
</script>
{
using (Form5 f5= new Form5())
{
f5.ShowDialog();
.....这里的代码我忘了.
};
}
可能编不过去
父窗体
private string m_strText; //用来储存返回的String
Public void SetFormat(string strText) //用来处理你想作的更新操作
{
this.m_strText=strText;
}
private void OpenChildWindow()// 打开子窗体
{
frmChild frm=new frmChild();
frm.setParentWindow(this);
frm.ShowDialog();
}子窗体:
private frmParent m_frmParent;
public void setParentWindow( frmParent frm)//获得父窗体实例
{
this.m_frmParent=frm;
}
private void frmChild_close()
{
this.m_frmParent.SetFormat(string strText);
}
你看看能用不?
http://www.mikecat.net/threadview.asp?forumID=9&threadID=41 里边有个例子。
不怕是病毒的话直接下载这个:http://www.mikecat.net/mikeapp/MikeCat_popvalue.rar
Form2 form2 = new Form2();
form2.ShowDialog();
if (form2.DialogResult == DialogResult.OK)
MessageBox.Show(form2.textBox1.Text);
不过都有答案了,我就不多次一举了.哈哈;)
在WindowsForm中使用委托
function OpenWin()
{
var strTemp = window.showModalDialog( 'yourUrl','dialogWidth=200px,dialogHeight=80px;' );
if(strTemp != null)
{
document.yourForm.txtHidden.value=strTemp;
document.yourForm.submit();
}
} -----in your form aspx-----
<INPUT id="txtHidden" type="hidden" name="txtHidden" runat="server"> -----in your form cs------
if( this.IsPostBack )
{
if( txtHidden.Value != "" )
{
//Do what you want here
txtHidden.Value = ""; //Clear data
}
}