passing parameters from one page to another

Discussion in 'ASP .Net' started by Paul, Jun 4, 2008.

  1. Paul

    Paul Guest

    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.
    --
    Paul G
    Software engineer.
     
    Paul, Jun 4, 2008
    #1
    1. Advertising

  2. Paul

    Paul Guest

    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" wrote:

    > 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...
    >
    > --
    > Patrice
    >
    > "Paul" <> a crit dans le message de groupe de
    > discussion : ...
    > > 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.
    > > --
    > > Paul G
    > > Software engineer.

    >
    >
     
    Paul, Jun 4, 2008
    #2
    1. Advertising

  3. 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

    "Paul" <> wrote in message
    news:...
    > 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.
    > --
    > Paul G
    > Software engineer.
     
    Peter Bromberg [C# MVP], Jun 4, 2008
    #3
  4. Paul

    Paul Guest

    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 [C# MVP]" wrote:

    > 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
    >
    > "Paul" <> wrote in message
    > news:...
    > > 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.
    > > --
    > > Paul G
    > > Software engineer.

    >
     
    Paul, Jun 4, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Smith

    passing data from one page to another

    Brian Smith, Jul 15, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    5,131
    Todd Thompson
    Jul 15, 2003
  2. loveNUNO
    Replies:
    2
    Views:
    922
    loveNUNO
    Nov 20, 2003
  3. Robert Cohen
    Replies:
    3
    Views:
    275
    Andrew Durstewitz
    Jul 15, 2003
  4. Mike
    Replies:
    1
    Views:
    120
    monkey
    Dec 2, 2003
  5. Gabriella
    Replies:
    0
    Views:
    98
    Gabriella
    Sep 21, 2006
Loading...

Share This Page