Monday, March 26, 2012

pass value to the second page

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,
ABabhishek007p@.hotmail.com wrote:
> 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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
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...=books&n=507846
Jesse Liberty also knows how to write a book :
http://www.amazon.com/exec/obidos/t...=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

> 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
Also a video says more than 1000 pictures :

http://www.microsoft.com/events/ser...tialaspnet.mspx

Cheers,
Tom Pester

> 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.

hi,

via redirect.

thanks,
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
This article provides some useful samples about uploading and downloading
files with ASP.NET:
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

<abhishek007p@.hotmail.com> wrote in message
news:1123534014.754404.8740@.f14g2000cwb.googlegrou ps.com...
> 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

0 comments:

Post a Comment