| Author: divya 07 Jan 2009 | Member Level: Gold | Rating:  Points: 3 |
Hi, U can do it storing the value in textbox to a session variable,or u can pass the value through querystring when redirecting to other page. Session variable In the form 1 u can store that in session variable as follows session["text"]=textbox1.text.tostring();
Query string
response.redirect(form2.aspx?ID=" + textbox1.text.tostring() + ") Then u can take this value from the page load or in any event as follows string str=request("id");
|
| Author: Syed Shakeer Hussain 07 Jan 2009 | Member Level: Diamond | Rating:  Points: 4 |
Hi.. gopal
Hi..first page value in second page
create one New class as A Class A {
//int that decalare a varialbe as username
pubilic static string username="vaibhav";
}
which page you want username you can use it.
Class B { //suppsoe you want to display username in a txtbox1
textusername.Text=A.username;
}
//Static variable can be accessed with the class Name itself..
so..without using Session,Cookies..you can pass value to another page by using static variable
Thanks & Regards! Syed Shakeer Hussain
|
| Author: Abhi 07 Jan 2009 | Member Level: Gold | Rating:  Points: 2 |
hi, go to form1.designer.cs make your textbox as public
then goto form2
create object of form1 class
form1 objfrm = new form1
string str = objfrm.textbox1.text
|
| Author: sridhar 07 Jan 2009 | Member Level: Bronze | Rating:  Points: 3 |
gopal u can use properties concept or overloaded constructor
write overload constructor in form 2
ex: Form2(string val) { textbox1.text=val; }
in form1 button click
create the form2 object
Form2 f2=new form2(textbox.text); form1.hide; form2.show()
and one more thing as per my knowledge there is no session and query string concept in windows application
|