|
-
Aug 19th, 2005, 03:46 PM
#1
Thread Starter
Member
problem with form
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
-
Aug 19th, 2005, 05:19 PM
#2
Frenzied Member
Re: problem with form
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.
-
Aug 19th, 2005, 07:41 PM
#3
Re: problem with form
Moved to ASP.NET Forum.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 21st, 2005, 06:24 AM
#4
Junior Member
Re: problem with form
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 ..........
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|