473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

value from another form

IN c# : how to get value from another form ..........................................


In 1st form there is a textBox

that textbox value i want to another form in label.......
Mar 31 '08 #1
5 1517
Im assuming your second form is on a second page because you cannot have multiple forms on a page...

There are several ways to do this:

1. Via request:

C#
string url = "yourpage.aspx?Textbox=" + YourTextboxId.Text;
Response.Redirect(url);

HTML
<asp:TextBox runat="server" id="YourTextboxId" ... ></asp:TextBox>

- To retrieve the value in C# : Request.QueryString["Textbox"];

2. Using Session state:

Session["TextboxValue"] = YourTextboxId.Text;

- To retrieve: Session["TextboxValue"];

Hope this helps...
Mar 31 '08 #2
sir ,,,

in a windows application ..........

i want code.....


i think like its a website code.....
Apr 1 '08 #3
r035198x
13,262 8TB
sir ,,,

in a windows application ..........

i want code.....


i think like its a website code.....
How are the forms related?
Apr 1 '08 #4
How are the forms related?

today i got my ans......


from

constructor:-

1st form :-

private void f1_b1_Click(object sender, EventArgs e)
{

Form2 f2 = new Form2(f1_t1.Text); this.Hide();
f2.Show();

}


2nd form :-

public partial class Form2 : Form
{
public Form2(string value)
{
InitializeComponent();

f2_l2.Text = value;

}
Apr 2 '08 #5
kenobewan
4,871 Expert 4TB
sir ,,,

in a windows application ..........

i want code.....


i think like its a website code.....
In your first post please state whether it is windows, saves everybody's time. Please read the posting guidelines before your next post. Thanks.

MODERATOR
Apr 2 '08 #6

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

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
3
by: Bills | last post by:
I know this is simple but I am stumped. Trying to get the value of a TextBox from another form. Form name is frmStart and Tbox name is tbxInis. In vb6 I could just use frmStart.tbxInis.text but...
9
by: ckerns | last post by:
I want to loop thru an array of controls,(39 of them...defaults = 0). If value is null or non-numeric I want to assign the value of "0". rowString = "L411" //conrol name if (isNaN(eval...
2
by: alpha_male | last post by:
Hello What way would be the best of selecting value by using another form? I use command button wizard to open another form. But in what way I can return the current record's value to the...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
1
by: meganrobertson22 | last post by:
Hi Everyone- I am trying to use a simple macro to set the value of a combo box on a form, and I can't get it to work. I have a macro with 2 actions: OpenForm and SetValue. I can open my form,...
0
by: johnson_cy | last post by:
I am using Access 2000. My main form has a record source of a table (employeeTbl with key of . It is filtering the record results. My subform and mainform have the link child/link master set...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
5
by: Rex | last post by:
Hi, I want to change a value in one table depending on the value(s) in another table. I am trying to achieve this in a form. to elaborate I have a many-to-many relationship between tables...
9
by: AMBLY | last post by:
Hello ! Hope someone might be able to help me with this one. I run Access2000 on XP. I have a form : frmONE- which contains a txt field: ctrCTN from my table/database. The values in ctrCTN are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.