将值从一个页面传递到另一个页面? [英] Passing value from one page to another page?
本文介绍了将值从一个页面传递到另一个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我执行并提交点击时,如何从一个值传递给另一个值?
How can i pass some value from one from to another from when i perform and submit click?
推荐答案
您可以按如下方式发送它:
假设从一个到两个你想要通过你需要的值。
You can send it as follows:
Suppose from from one to from two you want to pass you require values.
string value1,value2;
int value3,value4;
protected void btn_click(objectbtn sender, eventarg e)
{
from2 obj=new from2(value1,value2,value3,value4);
obj.show();
}
在from2中你只需要在构造函数中初始化值并获得这些值。
希望这会有所帮助。
谢谢。
on in the from2 you just initialize the value in a constructor and get those value.
Hope this helps.
Thanks.
参考这些链接
如何将值传递给另一个表单 [ ^ ]
请将值从一个表单传递到另一个表单 [ ^ ]
Refer these links
How to Pass values to another Form[^]
HOw to pass values from one Form to another[^]
您可以发送您的值,并将其存储为您的常规数据类型:
You can send your value and in new for store it to your general data types:
string value1,value2;
int value3,value4;
protected void btn_click(objectbtn sender, eventarg e)
{
from2 obj=new from2(value1,value2,value3,value4);
obj.show();
}
------------------------------ ---------------------------------------
以新的形式这样做:
---------------------------------------------------------------------
In new form do this:
public class form2
{
//General Data types
string value1,value2;
int value3,value4;
//cosntructor
form2(string value1,string value2,int value1,int value2)
{
//store it to general data types so you can use it all over your calss
this.value1=value1;
this.value2=value2;
this.value3=value3;
this.value4=value4;
}
}
这篇关于将值从一个页面传递到另一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文