Home | Submit an interview question | Filter by category | Filter by job function | Filter by company
 
Member Information
User Id
Password
 
Forgot Password
Technology Category
.NET (1202)
Languages (103)
Database (146)
Operating System (48)
Reporting (5)
Third-Party Tools (2)
Testing (91)
OOP (75)
Web Development (40)
Design Patterns (89)
General (9)
Networking (88)
Hardware (63)
Brain Exercise (2)
Others (37)
 Our Network
.NET Heaven
C# Corner
Interview Corner
Longhorn Corner
Mindcracker
VB.NET Heaven
Home » .NET » .NET
i had created two forms.form1 & form2.form1 consists of a textbox & form2 consists of a label and a button.i want to transfer the text in the textbox in form1 to the label in form2 when the button in form2 was clicked.how can i do it?
Posted by achu Jun 27, 2009
Viewed : 784 times
Major Category : .NET
Minor Category : Windows Forms
Total Replies : 1
Become a Sponsor
 EDITORIAL ANSWER  
No Reply Yet
 ANSWERS BY USERS  
DRISHTY
Jun 29, 2009

 à In Page_Load event of form2.aspx.cs, add following code :

 

Button1.Attributes.Add("onClick", "return textTransfer();");

 

 

à In head tag of form2.aspx add following code :

 

<script language="javascript">

    function textTransfer() {

    debugger;

    var doc=document.forms[0];

    var txt=Label1.innerHTML;

    window.open ("form1.aspx?val="+txt,"mywindow","scrollbars=no,resizable=yes,width=400,height=280");

    }

    </script>

 

 

à In Page_Load event of form1.aspx.cs, add following code :

 

TextBox1.Text = Request.QueryString["val"].ToString();

  
1

 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Advertise with us
Current Version: 2.2009.3.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved