pass value to the second page

A

abhishek007p

hi,

i am new to asp.net. here is what i want to do. i have 2 aspx pages,
first.aspx and second.aspx

now from the first.aspx i want to give the second.aspx page values like

second.aspx?DownloadFile=1

so, the second page give the user the requested file for download.

any suggestions, i am doing it in vb.net ?

and can somone recommend a ASP.NET via VB.NET book.

thanks,
AB
 
C

Curt_C [MVP]

hi,

i am new to asp.net. here is what i want to do. i have 2 aspx pages,
first.aspx and second.aspx

now from the first.aspx i want to give the second.aspx page values like

second.aspx?DownloadFile=1

so, the second page give the user the requested file for download.

any suggestions, i am doing it in vb.net ?

and can somone recommend a ASP.NET via VB.NET book.

thanks,
AB

how are you getting to the second page? Just write the QueryString onto
the link, or in the redirect.
 
T

tom pester

Hi AB,

I think this book is good cause the other is recognized as a good teacher.
I haven't read it though (I came from classic asp and read on the internet
the howto's)
http://www.amazon.com/exec/obidos/t...104-3119301-4387951?v=glance&s=books&n=507846
Jesse Liberty also knows how to write a book :
http://www.amazon.com/exec/obidos/t...104-3119301-4387951?v=glance&s=books&n=507846

The simplest way to solve your problem is to do a response.redirect to the
file you wish to push to your user.

Let me know if you have any more questions...

Cheers,
Tom Pester
 
A

abhishek007p

hi,
thanks a lot everyone. i have sloved the problem!

here is how:

First.aspx
Private Sub LinkButton1_Click(...bla bla)
Response.Redirect("second.aspx?DownloadFile=1")
End Sub

Second.aspx
Private Sub Page_Load(...bla bla)
Dim MyTemp As String
MyTemp = Request.Item("DownloadFile")

Select Case MyTemp
Case "1"
Response.Redirect("MyFile1.zip")
Case "2"
Response.Redirect("MyFile2.zip")
Case Else
MsgBox("Hello World", MsgBoxStyle.Information)
End Select
End Sub

thank, bye,
AB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top