Thanks for your help, David.
I am using the following code in page 1.
Partial Class _Default
Inherits System.Web.UI.Page
Public instance As Page
Public mySession As HttpSessionState
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.BufferOutput = True
instance = New Page
mySession = instance.Session
mySession("DummyValue") = "A500300300" 'I am using a
dummy value at the moment, this will be replaced from the QueryString
Response.Redirect("EmpList.aspx")
End Sub
End Class
In page 2 I have put in the following code:
Partial Class EmpList
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
SqlDataSource1.SelectParameters.Item(1).DefaultValue =
mySession("DummyValue").ToString
End Sub
End Class
Here, it is complaining that mySession has not been declared.
Where should I put the declaration?
Nirmal
Chris is right on it for the querystring. You asked to redirect to
another page and pass parameters, but not as a query string.
To do this, you could use session state. Building on Chris' code:
On first page:
String qsValue = Request.QueryString["paramName"];
<-- qsValue data manipulation here -->
Session["qsValue"] = qsValue;
Response.Redirect("yourpage.aspx");
On second page:
String sessionValue = Session["qsValue].ToString();
From here you can manipulate it however you wish on the second, or
subsequent, pages.
--
David Longnecker
Web Developer
http://blog.tiredstudent.com
I am a newbie trying to learn ASP.net 2.0.
I want to retrieve the QueryString and process it to produce some
parameters.
I then want to redirect the user to another page, passing these
parameters, but not as a querystring.
Any help would be gratefully received.
Nirmal Singh