473,324 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Passing multiple values using Response.Redirect

hie there, i want to be able to pass multiple parameters
to another page. currently, i am able to do so, but
somehow i feel it is not the correct way to do it. below
is part of what i have so far.

'first page
Private Sub btnOK_ServerClick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnOK.Click
Response.Redirect("InputValues.aspx?Requestor=" &
txtRequestor.Text & " Lower= " & txtLower.Text)
End Sub

'second page
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
Dim strRequestor As String
strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)
End Sub

the output i will get is :
Requestor = * Lower = 10

My question is, how can i pass the 2nd parameter(in the
txtLower.Text) to the next page without passing the
keyword "Lower" and still obtain the same output?

i want my second page to look like this:

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
Dim strRequestor As String
Dim strLower As String
strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)
Response.Write("<br>")
strLower = Request.QueryString("Lower")
Response.Write(strLower)
End Sub

Please help, and thanx in advance.

Nov 17 '05 #1
7 43066
Hi,

You can use Server.Transfer("InputValues.aspx",true) to call the
InputValues.aspx page with the Form and QueryString data.

You can also take advantage of Context while using
Server.Transfer("InputValues.aspx") and send any data that you want via
Context.Items

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
hie natty. thanx 4 your reply. i've tried using your
method, but i still do not get the output i wanted, that
is how do i pass multiple parameters to the next page.
Thanx!
-----Original Message-----
Hi,

You can use Server.Transfer("InputValues.aspx",true) to call theInputValues.aspx page with the Form and QueryString data.

You can also take advantage of Context while using
Server.Transfer("InputValues.aspx") and send any data that you want viaContext.Items

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Nov 17 '05 #3
Hi,
The calling page :
Context.Items.Add("DataA","yourData");
Context.Items.Add("ObjectData",System.DateTime.Now );

the target page :

string StringData = (string)Context["DataA"];
System.DateTime oDateTime = (System.DateTime)Context["ObjectData"]
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4
First method:

If you are using the request.querystring use "&" between
the values

Response.Redirect("InputValues.aspx?Requestor=" &
txtRequestor.Text & "&Lower= " & txtLower.Text)

InputValues.aspx page retrieve the values:

strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)

strLower = Request.QueryString("Lower")
Response.Write("Lower = " & strLower)

Second Method:

Use session Variables if you don't want to display these
values in the header

on page 1
session("Requestor")=txtRequestor.Text
Session("Lower")=txtlower.text
response.redirect("InputValues.aspx")

In the InputValues.aspx page
strRequestor=session("Requestor")
strLower=Session("Lower")
Session("Requestor")=nothing
Session("Lower")=nothing

Hope that helps.
-----Original Message-----
hie there, i want to be able to pass multiple parameters
to another page. currently, i am able to do so, but
somehow i feel it is not the correct way to do it. below
is part of what i have so far.

'first page
Private Sub btnOK_ServerClick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnOK.Click
Response.Redirect("InputValues.aspx?Requestor=" &
txtRequestor.Text & " Lower= " & txtLower.Text)
End Sub

'second page
Private Sub Page_Load(ByVal sender As System.Object, ByVale As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim strRequestor As String
strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)
End Sub

the output i will get is :
Requestor = * Lower = 10

My question is, how can i pass the 2nd parameter(in the
txtLower.Text) to the next page without passing the
keyword "Lower" and still obtain the same output?

i want my second page to look like this:

Private Sub Page_Load(ByVal sender As System.Object, ByVale As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim strRequestor As String
Dim strLower As String
strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)
Response.Write("<br>")
strLower = Request.QueryString("Lower")
Response.Write(strLower)
End Sub

Please help, and thanx in advance.

.

Nov 17 '05 #5
Do you HAVE to use the 2nd page. Sometimes it's best to do the processing
in a single page...

Assuming you have to do it that way,
why not use Session to transfer the data. Just clean up after yourself on
the 2nd page by removing the values after you extract the values.


"Natty Gur" <na***@dao2com.com> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Hi,

You can use Server.Transfer("InputValues.aspx",true) to call the
InputValues.aspx page with the Form and QueryString data.

You can also take advantage of Context while using
Server.Transfer("InputValues.aspx") and send any data that you want via
Context.Items

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #6
hie makthar! thanx a lot 4 your help. it solved my prob! :)

-----Original Message-----
First method:

If you are using the request.querystring use "&" between
the values

Response.Redirect("InputValues.aspx?Requestor=" &
txtRequestor.Text & "&Lower= " & txtLower.Text)

InputValues.aspx page retrieve the values:

strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)

strLower = Request.QueryString("Lower")
Response.Write("Lower = " & strLower)

Second Method:

Use session Variables if you don't want to display these
values in the header

on page 1
session("Requestor")=txtRequestor.Text
Session("Lower")=txtlower.text
response.redirect("InputValues.aspx")

In the InputValues.aspx page
strRequestor=session("Requestor")
strLower=Session("Lower")
Session("Requestor")=nothing
Session("Lower")=nothing

Hope that helps.
-----Original Message-----
hie there, i want to be able to pass multiple parameters
to another page. currently, i am able to do so, but
somehow i feel it is not the correct way to do it. below
is part of what i have so far.

'first page
Private Sub btnOK_ServerClick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnOK.Click
Response.Redirect("InputValues.aspx?Requestor=" & txtRequestor.Text & " Lower= " & txtLower.Text)
End Sub

'second page
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
Dim strRequestor As String
strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)
End Sub

the output i will get is :
Requestor = * Lower = 10

My question is, how can i pass the 2nd parameter(in the
txtLower.Text) to the next page without passing the
keyword "Lower" and still obtain the same output?

i want my second page to look like this:

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
Dim strRequestor As String
Dim strLower As String
strRequestor = Request.QueryString("Requestor")
Response.Write("Requestor = " & strRequestor)
Response.Write("<br>")
strLower = Request.QueryString("Lower")
Response.Write(strLower)
End Sub

Please help, and thanx in advance.

.

.

Nov 17 '05 #7
thanx david 4 your suggestion. appreciate it very much.
-----Original Message-----
Do you HAVE to use the 2nd page. Sometimes it's best to do the processingin a single page...

Assuming you have to do it that way,
why not use Session to transfer the data. Just clean up after yourself onthe 2nd page by removing the values after you extract the values.

"Natty Gur" <na***@dao2com.com> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Hi,

You can use Server.Transfer("InputValues.aspx",true) to call the InputValues.aspx page with the Form and QueryString data.
You can also take advantage of Context while using
Server.Transfer("InputValues.aspx") and send any data that you want via Context.Items

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!

.

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike P | last post by:
I want write a method to send several strings to a webpage using Response.Redirect (I'm trying to find out why my website keeps crashing). If I write a method to do this I can obviously only do a...
2
by: Nathan Sokalski | last post by:
I am using the Response.Redirect method in a User Control to allow visitors to click an ImageButton to take them to another page. However, when I click the ImageButton I recieve the following...
1
by: Sridhar | last post by:
Hi, I have a form where I have several text boxes. I am filling all those values and when I click on submit I am redirecting to new webform using Response.Redirect(). In the new webform if I...
9
by: anuragsji | last post by:
Hi, I have one combo box and GO button on the click of GO button page submitted and according to selection of one of the option from combo I want to redirect my page to some new asp page but at...
0
by: Dornel | last post by:
Hi all, My session variables are lost when I using response.redirect at first time... In the second time, the problem not exists. example in page 1(create session and redirect): ...
1
by: chariclark | last post by:
This may be a quick fix post... ---------------------------- I am having trouble passing multiple values into stored procedure. Here it is below: CREATE Procedure spGetAssociateds ( @PDSI...
3
by: André | last post by:
Hi, I want to include a graphic made in file2 into file. File must first send a value to file2 (with Response.Redirect) which will be used for the graphic. My problem is that only the graphic is...
5
by: phanimadhav | last post by:
Response.Redirect("explain.aspx?firstimportname="+filename); This is my statement.In this statement i am sending only single value to next page.but i want to pass multiple values by using multiple...
4
by: dasnowball | last post by:
Hi everyone, I'm developing an application using ASP.NET with VB, connected to a SQL Server, running on .NET 2 framework. I am developing a training system where documents are uploaded into the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.