Hi
My project has two webforms: webform1.aspx and webform2.aspx
Please tell me how can i get the Text1.text value from webform1.aspx to
textbox2.text from webform2.aspx. Or if you have any other sugestions
please write me
Printable View
Hi
My project has two webforms: webform1.aspx and webform2.aspx
Please tell me how can i get the Text1.text value from webform1.aspx to
textbox2.text from webform2.aspx. Or if you have any other sugestions
please write me
There are two ways to do it. The first is the QueryString
In the code that is changing the page put this:
VB Code:
Response.Redirect("Webform2.aspx?Name=" _ this.txtName.Text + "&LastName=" _ this.txtLastName.Text)
In the load event of the page your moving to put this
VB Code:
txtBox1.Text = Request.QueryString["Name"] txtBox2.Text = Request.QueryString["LastName"]
The second way is:
Where the code is that is changing the page.
VB Code:
session("FName") = txtName.Text session("LName") = txtLastName.Text
The load event of the other page
VB Code:
txtBox1.Text = Session("FName") txtBox2.Text = Session("LName")
They both have their advantages, but most of the time the first way is the better way.
Moved to ASP.NET Forum. ;)
Hi,
You may user Server.Transfer("pagename")
to move data from one page to another but you have to use the following function code to transefer the form field ..
Public ReadOnly Property Infant() As Long
Get
If TxtInfant.Text <> "" Then
Return Val(TxtInfant.Text)
Else
Return 0
End If
End Get
End Property
then on movenext page commnad button
use the following procedure
Server.Transfer("pagename")
in the next page load event
write the following code to get the result
Dim fp As Previouspage (firstpageclass name)
If Not IsPostBack Then
fp = CType(context.Handler, firstpage class name)
txtCName.Text = fp.Infant()
' TxtCno.Text = fp.ConNo()
'TxtCno.Text = "80"
' TxtSTD.Text = fp.cStdate
' TxtSEd.Text = fp.ceddate
' binddata()
End If
This is one of the way ..........