passing parameters from one page to another

P

Paul

Hi, just wondering if anyone can provide a brief example of passing
parameters from one webpage to another, C# VS2005? I need to pass several
selected values of dropdown list boxes to a secondary page. I have a
response.redirect("secondpage") in a button click event.
Thanks.
 
P

Paul

thanks for the response. I tried to impliment the server.transfer method but
WebForm1 is not recognized on the destination form. I replaced Webform1 with
the name of my source webform but it is still not defined on the destination
page.

private void Page_Load
(object sender, System.EventArgs e)
{
//create instance of source web form
MyWebForm1 wf1;
//get reference to current handler instance
wf1=(MyWebForm1)Context.Handler;
Label1.Text=wf1.Name;
Label2.Text=wf1.EMail;
}

--
Paul G
Software engineer.


Patrice said:
Try :

http://www.dotnetbips.com/articles/c585b4d3-93c5-4c66-9d49-8e1946f4d311.aspx

Plus :
- you could pass a single value and read the rest from a db especially if
you need to persist those values on a longer term (first step of a db update
for example)
- if this is a multistep operation you could post to the same page and have
a wizard like logic inside your page...
 
P

Peter Bromberg [C# MVP]

Easiest way: put the values on the querystring and read them back on the
target page. You could also consider storing the items in Session state.
Peter
 
P

Paul

Hi ended up using the query string which was easy to impliment. Would be
nice to figure out how to create an instance of the source web form on the
destination webform. I created a new post (create an instance of one webform
on another) to see if anyone has done it. Thanks.
--
Paul G
Software engineer.


Peter Bromberg said:
Easiest way: put the values on the querystring and read them back on the
target page. You could also consider storing the items in Session state.
Peter
 

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,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top