Groups | Blog | Home
all groups > vb.net > may 2004 >

vb.net : Passing form values from one page to other. Please, help me out. Thank You.


dvogel
5/24/2004 3:01:03 PM
You can use the Session collection like this.

Session("city") = "anytown

Ken Tucker [MVP]
5/24/2004 6:15:41 PM
Hi,

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim url As String

url = "anotherwebform.aspx?name=" & TextBox1.Text & "&email=" &
TextBox2.Text
Response.Redirect(url)
End Sub

In anotherpage.aspx

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Label1.Text = Request.QueryString("name")
Label2.Text = Request.QueryString("email")
End Sub

Ken
------------------------
[quoted text, click to view]

Miguel Dias Moura
5/24/2004 10:42:32 PM
Hello,

i created an ASP.net / VB page with a really big form.

Now i want to create 4 pages and in each one i will place 1/4 of the big
form.

The last page will send all the form values by email.

How can i send the form values from one page to the next one?

I looked everywhere and i wasn't able to make this work. I found a good
ASP.net / C code example in
http://www.dotnetbips.com/displayarticle.aspx?id=79. However, i am having
problems in translating it to VB.
Yes, i did used the most 2 common translaters but i am still having
problems.

Is there someone that can help me doing this? 2 sample ASP.net / VB pages
would be great.

Anyway, any help would be apreciated.

Thank You Very Much,
Miguel


Cor Ligthert
5/25/2004 8:59:35 AM
Hi Miguel,

This is the simplest way in my opinion.
\\\
Form1 in the page load event
if ispostback
session.item"whatever" = mytextbox.text
end if
Form2 in the page load event
if not ispostback
mylabel.text = session.item("whatever")
end if
///
I hope this helps a little bit?

Cor

AddThis Social Bookmark Button