js不是就可以搞定吗?
点击按钮打开新窗口的时候传递opener需要接收返回值的控件ID,新页面选择后传递回opener
点击按钮打开新窗口的时候传递opener需要接收返回值的控件ID,新页面选择后传递回opener
解决方案 »
- 应该如何设置css文件
- 很多字段要进行“ 数据为空。不能对空值调用此方法或属性”处理 怎么才有更好的处理方法的方法
- DataList
- Session值无故丢失的现象(机率大概是50%,绝对没有代码去释放).
- componentart 表格控件, 分级展现时 第二,三。。。级排序问题
- 上传组件写的时候的问题~可以传图不能传附件?奇怪
- 请问:在CS中怎么得到导致页面刷新的控件的ID
- IE Web Controls安装问题!请帮忙!(在线等待)
- 请问:PDB格式文件用什么可以打开呀?
- 是不是一个ASP.NET项目里只能有一个NAMESPACE啊??
- 救命啊!为什么我把我做一个项目传到服务器上时总是出错。而传从网上下载的就不会出错。为什么呢
- 关于ASP。NET的用户登录!!
string name="data";
Response.Redirect("webform1.aspx?name=" +name);或者你用window.operner
private void Button1_Click
(object sender, System.EventArgs e)
{
string url;
url="anotherwebform.aspx?name=" +
TextBox1.Text + "&email=" +
TextBox2.Text;
Response.Redirect(url);
}Destination Web Form
private void Page_Load
(object sender, System.EventArgs e)
{
Label1.Text=Request.QueryString["name"];
Label2.Text=Request.QueryString["email"];
}也可以使用Session
Create the web form with controls
Create property Get procedures that will return control values
Provide some button or link button that posts the form back
In the button click event handler call Server.Transfer method that will transfer execution to the specified form
In the second form you can get a reference to the first form instance by using Context.Handler property. Then you will use the get properties we created to access the control values.
The code to accomplish this is somewhat complex and is shown below:
Source Web Form
Add following properties to the web form:
public string Name
{
get
{
return TextBox1.Text;
}
}public string EMail
{
get
{
return TextBox2.Text;
}
}Now, call Server.Transfer.
private void Button1_Click
(object sender, System.EventArgs e)
{
Server.Transfer("anotherwebform.aspx");
}Destination Web Form
private void Page_Load
(object sender, System.EventArgs e)
{
//create instance of source web form
WebForm1 wf1;
//get reference to current handler instance
wf1=(WebForm1)Context.Handler;
Label1.Text=wf1.Name;
Label2.Text=wf1.EMail;
}Summary
不要pop新窗口来选择,在一个页面做。
用<ASP:Panel/>;选择之后填充的数据放一个Panel,供选择的数据放另一个Panel,用户选择是隐藏前一个Panel,显示后一个;选择完之后,在还原。
ms-help://MS.VSCC/MS.MSDNVS.2052/cpguide/html/cpconpassingservercontrolvaluesbetweenpages.htm对这种情况好象不适合。
我看用showmodaldialog()或showModelessDialog()最合适
不存在asp.net与asp的什么区别,只要可以实现,且这也是一个好办法至于这种方式的参数传递就不用说了吧。
showmodaldialog()或showModelessDialog()
怎么做?
ms-help://MS.VSCC/MS.MSDNVS.2052/cpguide/html/cpconpassingservercontrolvaluesbetweenpages.htm这个呢是在服务端的,可以正向的向下一个页面传递任何类型的属性,是不错。
反过来,以上都没有看见有从第二个页面把参数返回到第一个页面服务端的方法,都是客户端的方法。
有没有服务端的从第二个页面把参数返回到第一个页面,也要是可以传递任何类型的数据的方法?