how do i copy textbox contents of 1 form to another form
Answers were Sorted based on User's Feedback
Answer / umedh singh
Hi
Windows Application Coding
##Form1##
on button_click event
Form2 f2 =new Form2();
f2.form1inform2=this;
f2.show();
##Form2##
public form1 form1inform2;//variable
on form2_load event
this.TextBox1.text=((form1)this.form1inform2).textbox1.text;
.........................................
Web Application coding use QueryString
on button_click event
Response.Redirect("Default2.aspx?a="+textBox1.text);
on page_load event
textBox1.text=Request.QueryString["a"].toString();
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / sreeni
both the above answers are correct. Use First Answer for
Web applications and Second one for Windows applications.
| Is This Answer Correct ? | 7 Yes | 5 No |
Answer / justin dhas
Hi,
By using state management variables you can get the value of textbox from one form to another,like querystring,session,cookies etc
eg)
Session["value"]=textboxid.Text;//Set the value in one form
string s=Session["value".ToString()//get the value in another form
| Is This Answer Correct ? | 12 Yes | 14 No |
Answer / vishal m.s.
In 2nd form create an object for the 1st form
And write a code as below
//Object creation for form1 in form2(on command Button)
Form1 f1 = new Form1();
TextBox1.Text = f1.TextBox1.Text;
| Is This Answer Correct ? | 4 Yes | 29 No |
How to Link Different Data Sources Together?
How to export 2 datatables of a single dataset to 2 different worksheets of a single MSExcel file ?
Event Handling in C# Triggering a Button
Write a program to convert postfix expression to infix expression.
program to check if a number is "perfect number".
Write a program to count 3Letter, 4Letter and 5Letter words from a file and print the number of 3Letter, 4Letter and 5Letter words. Delimiter is space, tab, hifen. Also we should not consider the line in the file after we encounter # in that line.
Hello I am hosting remoting within IIS. Everything works just fine as long as I allow anonymous access at the IIS level. When I allow only Windows Authenticated sessions, something very strange happens: If the client activates the remote object with IP address - works fine If the client activates it using a machine name - get http 401 exception is thrown. The exception is thrown when the client calls the remote method. I set the channel's useDefaultCredentials property to true. Any idea how to allow Windows Authentication? Here is the call stack: System.Net.WebException: The remote server returned an error: (401) Unauthorized .. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean handshakeComplete) at System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob, Boolean handshakeComplete) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.Authenticate(String challenge, WebRequest webRequest, ICredentials credentials) at System.Net.AuthenticationManager.Authenticate(String challenge, WebRequest request, ICredentials credentials) at System.Net.AuthenticationState.AttemptAuthenticate (HttpWebRequest httpWebRequest, ICredentials authInfo) --- End of inner exception stack trace ---
write a Program to copy the string using switch case.
Code for Searching for Multiple Matches with the MatchCollection Class?
Write a program to count the number of characters, number of words, number of line in file.
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#
IS Array list is generic or non generic