472,143 Members | 1,586 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

How to get the value from one form to another form

hi........
am a new join programmer as a fresher....
in vb.net we can get the values of first form to second form by creating a object for the first form and take the values using that object in second form,but
i want to know how to retrive the data from one form to another existing form using c#
Nov 28 '06 #1
4 6218
kkmar
5
Hi

You can just use Session and pass the values.I am sure there might be some other way this is simple way to do.


Example

Session("textboxval") = txtbox1.value;

Call this session value on another page as

str = Session("txtboxval")

Try this not sure if there is any other way.
Nov 28 '06 #2
hi........
am a new join programmer as a fresher....
in vb.net we can get the values of first form to second form by creating a object for the first form and take the values using that object in second form,but
i want to know how to retrive the data from one form to another existing form using c#
the simplest way is...... it is posible by declaring global varible common to both form then it is possible call the first form value in thye second.... try it if you need further guide mail to me by kasspro@yahoo.com
Nov 28 '06 #3
AricC
1,892 Expert 1GB
Most people tend to stay away from global variables. Use session variables. Here is an old scripts post about using global variables.


HTH,
Aric
Nov 28 '06 #4
bplacker
121 100+
whats wrong with global variables??? I'm just asking, because I use them quite a bit.
Nov 28 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Bills | last post: by
9 posts views Thread by ckerns | last post: by
1 post views Thread by meganrobertson22 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.