1>form不用runat="server"
2>form的Action设置到要得到值的网页的URL
2>form的Action设置到要得到值的网页的URL
解决方案 »
- 请问gridview连接判断问题~!!!
- MVC3.0
- 求一正则表达式,验证控件宽度参数。
- 带母版页的个人空间的URL重写问题!!!!!!
- 如何使.net 2005 中 treeview只展开根接点,如何在一个父节点下添加节点后保持该父节点展开状态?
- 为什么我用oledb连接excel数据源时,到连接打开的时候就报"未找到可安装的IASM"错?
- dropdownlist 控件 问题
- 读取XML文件的问题
- 关于aspmenu菜单会被其他如ocx控件挡住,已有很多人问起过,一直没找到解决方案,期待高手出现
- 用asp.net可以在两个打开的窗口之间传递数据吗?如何传递?
- 请教动态创建时遇到的一个问题
- 今天我生日!
http://www.dotnetbips.com/displayarticle.aspx?id=79
不就是页面传值:以前许多老兄都答过: 占点位置::
Using Server.Transfer
This is somewhat complex but sophisticated method of passing values across pages. Here you expose the values you want to access in other pages as proprties of the page class. This methods require you to code extra properties that you can access in another web form. However, the efforts are worth considering. Overall this method is much cleaner and object oriented than earlier methods. The entire process works as follows:
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
然后提交
你直接打开“另一个ASPX页面” 你的表单更本就没有提交给他
他如何得到你的参数????