|
 |
aspx_beginners thread: Passing a Parameter to another page
Message #1 by f_behzadi@y... on Tue, 8 Oct 2002 17:49:51
|
|
Dear Members,
I want to pass a parameter(Integer) which has been calculated in page 1 of
my application to another page to do some other calculations. Please tell
me how I can do that.
I am very new to Programming.
Regards,
Fariborz
Message #2 by Imar Spaanjaars <Imar@S...> on Tue, 08 Oct 2002 18:52:04 +0200
|
|
You can use the QueryString, for example, if you want.
Here is a small example:
' Page 1
Page_Load()
' assuming DifficultCalculation returns an Integer
Dim i as Integer = DifficultCalculation(x, y, z)
Response.Redirect("NewPage.aspx?RESULT=" & i.ToString())
This takes the result of i and appends it to the QueryString.
Then on the next page, you can retrieve it like this:
' Page 2
Page_Load()
Dim i as Integer = Request.QueryString("RESULT")
There are lots of other ways to do the same. This isn't necessarily the
smartest nor the best way to do it, as it all depends on your needs.
I suggest you get yourself a copy of Beginning ASPX by Wrox, for example,
and read a bit about web applications, variables, POST Vs Get, Viewstate,
the postback model and other important concepts you'll need to know about
to be able to successfully build web apps.
Cheers,
Imar
At 05:49 PM 10/8/2002 +0000, you wrote:
>Dear Members,
>I want to pass a parameter(Integer) which has been calculated in page 1 of
>my application to another page to do some other calculations. Please tell
>me how I can do that.
>I am very new to Programming.
>
>Regards,
>Fariborz
Message #3 by ramprasad upadhyaya <rpu_forum@y...> on Tue, 8 Oct 2002 21:58:36 -0700 (PDT)
|
|
Hi,
There are so meny ways u could send a value from a page to another
1. Using Query string(If u r using response.redirect)
response.redirect("X.aspx?value="& intVal &"")
U can get this in other page by 'request("value")'
2. If u r using Javascript to move to page
document.form1.action="X.aspx?value="+ intVal ;
document.form1.method="post";
document.form1.submit();
U can get this in other page by 'request("value")'
------------------------------------------------
Let me know the status of the problem
ramprasad
f_behzadi@y... wrote:Dear Members,
I want to pass a parameter(Integer) which has been calculated in page 1 of
my application to another page to do some other calculations. Please tell
me how I can do that.
I am very new to Programming.
Regards,
Fariborz
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Regards,
Ramprasad Upadhyaya
---------------------------------
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
Message #4 by f_behzadi@y... on Wed, 9 Oct 2002 15:33:43
|
|
Thanks it was really helpful.
Fariborz
>
Hi,
There are so meny ways u could send a value from a page to another
1. Using Query string(If u r using response.redirect)
response.redirect("X.aspx?value="& intVal &"")
U can get this in other page by 'request("value")'
2. If u r using Javascript to move to page
document.form1.action="X.aspx?value="+ intVal ;
document.form1.method="post";
document.form1.submit();
U can get this in other page by 'request("value")'
------------------------------------------------
Let me know the status of the problem
ramprasad
f_behzadi@y... wrote:Dear Members,
I want to pass a parameter(Integer) which has been calculated in page 1 of
my application to another page to do some other calculations. Please tell
me how I can do that.
I am very new to Programming.
Regards,
Fariborz
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Regards,
Ramprasad Upadhyaya
---------------------------------
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
Message #5 by "Patterson, Stephanie L" <stephanie.l.patterson@i...> on Mon, 14 Oct 2002 13:03:28 -0700
|
|
Imar,
How do you do the Response.Redirect if you have more than one parameter (ex.
param1, param2, param3)?
Stephanie
-----Original Message-----
From: Imar Spaanjaars [mailto:Imar@S...]
Sent: Tuesday, October 08, 2002 9:52 AM
To: aspx_beginners
Subject: [aspx_beginners] Re: Passing a Parameter to another page
You can use the QueryString, for example, if you want.
Here is a small example:
' Page 1
Page_Load()
' assuming DifficultCalculation returns an Integer
Dim i as Integer = DifficultCalculation(x, y, z)
Response.Redirect("NewPage.aspx?RESULT=" & i.ToString())
This takes the result of i and appends it to the QueryString.
Then on the next page, you can retrieve it like this:
' Page 2
Page_Load()
Dim i as Integer = Request.QueryString("RESULT")
There are lots of other ways to do the same. This isn't necessarily the
smartest nor the best way to do it, as it all depends on your needs.
I suggest you get yourself a copy of Beginning ASPX by Wrox, for example,
and read a bit about web applications, variables, POST Vs Get, Viewstate,
the postback model and other important concepts you'll need to know about
to be able to successfully build web apps.
Cheers,
Imar
At 05:49 PM 10/8/2002 +0000, you wrote:
>Dear Members,
>I want to pass a parameter(Integer) which has been calculated in page 1 of
>my application to another page to do some other calculations. Please tell
>me how I can do that.
>I am very new to Programming.
>
>Regards,
>Fariborz
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #6 by Imar Spaanjaars <Imar@S...> on Mon, 14 Oct 2002 22:19:11 +0200
|
|
Hi Stephanie,
You can simply concatenate them (assuming you still use the QueryString).
The first name/value pair is separated from the file name with a ? and all
subsequent name/value pairs are separated with the & symbol
So eventually, the path and QueryString can look like this:
MyPage.aspx?value1=1&Value2=2&Value3=SomeOtherValue
You can build this in the following way:
' Page 1
Page_Load()
Dim iValue1 As Integer = 1
Dim iValue2 As Integer = 2
Dim sValue3 As String = "SomeOtherValue"
Response.Redirect("NewPage.aspx?Value1=" & iValue1.ToString() &
"&Value2=" & iValue2.ToString() & "&Value3=" & sValue3)
You can retrieve them on the receiving page the same way as with one variable:
Dim aString As String = Request.QueryString("Value3")
Now, aString will contain "SomeOtherValue"
HtH
Imar
At 01:03 PM 10/14/2002 -0700, you wrote:
>Imar,
>
>How do you do the Response.Redirect if you have more than one parameter (ex.
>param1, param2, param3)?
>
>Stephanie
>
>-----Original Message-----
>From: Imar Spaanjaars [mailto:Imar@S...]
>Sent: Tuesday, October 08, 2002 9:52 AM
>To: aspx_beginners
>Subject: [aspx_beginners] Re: Passing a Parameter to another page
>
>
>You can use the QueryString, for example, if you want.
>
>Here is a small example:
>
>' Page 1
>Page_Load()
> ' assuming DifficultCalculation returns an Integer
> Dim i as Integer = DifficultCalculation(x, y, z)
> Response.Redirect("NewPage.aspx?RESULT=" & i.ToString())
>
>This takes the result of i and appends it to the QueryString.
>
>Then on the next page, you can retrieve it like this:
>
>' Page 2
>Page_Load()
> Dim i as Integer = Request.QueryString("RESULT")
>
>
>There are lots of other ways to do the same. This isn't necessarily the
>smartest nor the best way to do it, as it all depends on your needs.
>
>I suggest you get yourself a copy of Beginning ASPX by Wrox, for example,
>and read a bit about web applications, variables, POST Vs Get, Viewstate,
>the postback model and other important concepts you'll need to know about
>to be able to successfully build web apps.
>
>Cheers,
Message #7 by "Patterson, Stephanie L" <stephanie.l.patterson@i...> on Mon, 14 Oct 2002 17:25:32 -0700
|
|
Imar, Thanks so much!!
Stephanie
-----Original Message-----
From: Imar Spaanjaars [mailto:Imar@S...]
Sent: Monday, October 14, 2002 1:19 PM
To: aspx_beginners
Subject: [aspx_beginners] Re: Passing a Parameter to another page
Hi Stephanie,
You can simply concatenate them (assuming you still use the QueryString).
The first name/value pair is separated from the file name with a ? and all
subsequent name/value pairs are separated with the & symbol
So eventually, the path and QueryString can look like this:
MyPage.aspx?value1=1&Value2=2&Value3=SomeOtherValue
You can build this in the following way:
' Page 1
Page_Load()
Dim iValue1 As Integer = 1
Dim iValue2 As Integer = 2
Dim sValue3 As String = "SomeOtherValue"
Response.Redirect("NewPage.aspx?Value1=" & iValue1.ToString() &
"&Value2=" & iValue2.ToString() & "&Value3=" & sValue3)
You can retrieve them on the receiving page the same way as with one
variable:
Dim aString As String = Request.QueryString("Value3")
Now, aString will contain "SomeOtherValue"
HtH
Imar
At 01:03 PM 10/14/2002 -0700, you wrote:
>Imar,
>
>How do you do the Response.Redirect if you have more than one parameter
(ex.
>param1, param2, param3)?
>
>Stephanie
>
>-----Original Message-----
>From: Imar Spaanjaars [mailto:Imar@S...]
>Sent: Tuesday, October 08, 2002 9:52 AM
>To: aspx_beginners
>Subject: [aspx_beginners] Re: Passing a Parameter to another page
>
>
>You can use the QueryString, for example, if you want.
>
>Here is a small example:
>
>' Page 1
>Page_Load()
> ' assuming DifficultCalculation returns an Integer
> Dim i as Integer = DifficultCalculation(x, y, z)
> Response.Redirect("NewPage.aspx?RESULT=" & i.ToString())
>
>This takes the result of i and appends it to the QueryString.
>
>Then on the next page, you can retrieve it like this:
>
>' Page 2
>Page_Load()
> Dim i as Integer = Request.QueryString("RESULT")
>
>
>There are lots of other ways to do the same. This isn't necessarily the
>smartest nor the best way to do it, as it all depends on your needs.
>
>I suggest you get yourself a copy of Beginning ASPX by Wrox, for example,
>and read a bit about web applications, variables, POST Vs Get, Viewstate,
>the postback model and other important concepts you'll need to know about
>to be able to successfully build web apps.
>
>Cheers,
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
|
|
 |