Posting Data ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • HANG  LAM

    #1

    Posting Data ??

    Hi,

    Simple question, Is there a way to post the data from one .aspx page
    to another page ?


    For example, I have a Page1.aspx that lets the user enter data like
    "Last Name", "First Name", but I want post that information into another
    ..aspx page (Page2.aspx ) .
    I know I can do a redirect to the second page ,but then I will have to
    build a "query string" .

    Is there a way just to post the data to the second page, just like the
    old .asp pages did before .aspx without having to build a "query string" ?

    Thanks,
    hang


  • Ray

    #2
    Re: Posting Data ??

    http://msdn.microsoft.com/library/de...sferTopic2.asp
    The Server.Transfer method is what I think you are looking for. When you
    post back to the original page, you can, depending on an action you define
    in your code, transfer execution of the submission to another page.

    Ray

    "HANG LAM" <hanglam@hotmai l.com> wrote in message
    news:uV8gFE0mDH A.2500@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi,
    >
    > Simple question, Is there a way to post the data from one .aspx page
    > to another page ?
    >
    >
    > For example, I have a Page1.aspx that lets the user enter data like
    > "Last Name", "First Name", but I want post that information into another
    > .aspx page (Page2.aspx ) .
    > I know I can do a redirect to the second page ,but then I will have[/color]
    to[color=blue]
    > build a "query string" .
    >
    > Is there a way just to post the data to the second page, just like[/color]
    the[color=blue]
    > old .asp pages did before .aspx without having to build a "query string" ?
    >
    > Thanks,
    > hang
    >
    >[/color]


    Comment

    • Jody Fisher

      #3
      Re: Posting Data ??

      hang

      I suspect what you are asking is - can you still use a post rather than a
      get in a form action?

      eg, <form action="page2.a spx" method="post".. ....

      The simple answer is yes, these methods will still work without any
      problems. You use the request.form("f ldName") to retreive the data. There
      are newer methods though which you should consider which make life a lot
      easier....

      If you have a number of fields on a page (within a form) you just have to
      put an <asp:button> on the page, double click on the button in VS and this
      will open up the code behind page. you can then just type in what you want
      it to do from there.... eg me.lblresponse. text = me.txtTextbox.t ext.

      Much quicker than the older methods. After recording the data you can then
      transfer all the headers (including your post data) to another page if that
      is what you require by using the server.transfer method.

      If this doesn't really answer your question perhaps you could give us an
      example of what you are trying to do

      regards


      --
      Jody
      [MCSD.Net]

      Jody


      "HANG LAM" <hanglam@hotmai l.com> wrote in message
      news:uV8gFE0mDH A.2500@TK2MSFTN GP10.phx.gbl...[color=blue]
      > Hi,
      >
      > Simple question, Is there a way to post the data from one .aspx page
      > to another page ?
      >
      >
      > For example, I have a Page1.aspx that lets the user enter data like
      > "Last Name", "First Name", but I want post that information into another
      > .aspx page (Page2.aspx ) .
      > I know I can do a redirect to the second page ,but then I will have[/color]
      to[color=blue]
      > build a "query string" .
      >
      > Is there a way just to post the data to the second page, just like[/color]
      the[color=blue]
      > old .asp pages did before .aspx without having to build a "query string" ?
      >
      > Thanks,
      > hang
      >
      >[/color]


      Comment

      Working...