Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
How can i pass some value from one from to another from when i perform and submit click?
Posted 1-Dec-12 4:43am
Comments
Maksud Saifullah Pulak at 1-Dec-12 9:47am
   
Can You please clear it weather it is winfrom for asp pages.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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(); 
}
on in the from2 you just initialize the value in a constructor and get those value.
 
Hope this helps.
Thanks.
  Permalink  
v2
Comments
ProgramFOX at 1-Dec-12 11:53am
   
Good answer, +5!
Maksud Saifullah Pulak at 1-Dec-12 11:59am
   
Thanks.
Rahul Bormon at 1-Dec-12 12:41pm
   
Thanks Maksud Saifullah.
Maksud Saifullah Pulak at 1-Dec-12 12:44pm
   
Welcome.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Rahul Bormon at 1-Dec-12 9:50am
   
Oh it is windows from.
__TR__ at 1-Dec-12 9:54am
   
The links show how to do it in windows application not web application.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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;
     }
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 315
1 OriginalGriff 273
2 Aajmot Sk 224
3 Marcin Kozub 210
4 Richard MacCutchan 200
0 OriginalGriff 7,853
1 Sergey Alexandrovich Kryukov 7,107
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100