How to pass simple parameters to a page

J

JezB

I know I can use the querystring mechanism to pass simple parameters to a
Page using Response.Redirect, but Im having problems getting this to work
using Server.Transfer or Server.Execute - is this by design ?

What is a simple alternative for passing optional parameters to a Page using
Server.Transfer or Server.Execute?

I don't want to store a session variable and check that in the called page -
too flaky.
 
J

JezB

I'm using Request.Params["param"] to interrogate the query string. Now, I
read somewhere that a Server.Transfer inherits the Request object from it's
calling form, rather than getting it's own, so that might be why I'm having
a problem.
 
B

bloomfield

Assuming you make a Server.Transfer from the Page1 to Page2
you can access Page1 from Page2 like this:
Page1 page1 = (Page1)Context.Handler;
in Page2. And so you can access the fields from the Page1:
page1.anypublicfield etc
much better then the query string I think.

--
(e-mail address removed)
www.bloomfield.as.ro
I'm using Request.Params["param"] to interrogate the query string. Now, I
read somewhere that a Server.Transfer inherits the Request object from it's
calling form, rather than getting it's own, so that might be why I'm having
a problem.

Last I knew you cant pass a querystring through on server.transfer/execute

a

work


page -
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top