Click here to Skip to main content
12,948,566 members (62,285 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
How can i pass some value from one from to another from when i perform and submit click?
Posted 1-Dec-12 3:43am
Comments
Maksud Saifullah Pulak 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 1-Dec-12 11:53am
   
Good answer, +5!
Maksud Saifullah Pulak 1-Dec-12 11:59am
   
Thanks.
Rahul Bormon 1-Dec-12 12:41pm
   
Thanks Maksud Saifullah.
Maksud Saifullah Pulak 1-Dec-12 12:44pm
   
Welcome.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Rahul Bormon 1-Dec-12 9:50am
   
Oh it is windows from.
__TR__ 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
Top Experts
Last 24hrsThis month
OriginalGriff 5,419
CHill60 3,275
Maciej Los 2,778
Jochen Arndt 1,935
ppolymorphe 1,795


Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2017
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