Shahid,
There are a few different methods depending on what type/length of data you
want to pass to the new page.
One of the simplest is to add the data to the Page.Context object like this:
Page 1:
Dim StringToTransfer As String = "My value to transfer (this could be any
type of object)"
Page.Context.Items.Add("MyKey", StringToTransfer)
Server.Transfer("page2.aspx")
Page 2:
Dim TransferredString As String = Ctype(Page.Context.Items.Item("MyKey"),
String)
Of course it would be more efficient to type the string with:
Page.Context.Items.Item("MyKey").ToString, but I wanted to show that any
object type could be passed within the context object.
One interesting possible drawback to this system is that page two gets
delivered to the client machine without the client receiving a redirect, so
the client's address will still read page1.aspx. Most of the time this isn't
an issue.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Shahid Juma" <sh*********@gmail.com> wrote in message
news:11********************@g47g2000cwa.googlegrou ps.com...
Hi,
This may be a very trivial answer but I was wondering if it possible to
have a ASP.NET page and on a user click, it transfers to another page.
Rather than redirecting to the new page, I want to pass some data with
it. I know I can do it using sessions but is it possible doing it in a
different way.
Thanks in advance,
Shahid