Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer to Dynamically Constructed Page

Status
Not open for further replies.

BDRichardson

Programmer
Jul 23, 2003
46
0
0
GB
Hi,

This may be silly or strange query, but is it sensible and practical to transfer to a dynamically constructed page?

By which, I mean I would like transfer to a page by clicking on a button. However, instead of using the PostBackUrl property, I wish to call a Page Constructor passing Arguments. Those arguments will be used to set properties for the Page to be loaded.

For example, something like:

btn_Click( Object sender, EventArgs e)
{
Page testPage = new TestPage( Arg1, Arg2, Arg3);
Server.Transfer( testPage);
}
 
I think Server.Transfer expects a virtual path (url), not an actual instance of a page object. What you can do is place your variables that you want to pass along into the current HttpContext, and they will be available in the code of the page you transferred to.

[blue]_______________________________________[/blue]
Business Logic:"AND when tweetle beetles battle with paddles in a puddle, they call it a tweetle beetle puddle paddle battle AND..." - Dr. Suess
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top