Posting values between pages

Discussion in 'ASP .Net' started by Water Cooler v2, Sep 3, 2005.

  1. That ASP.NET pages post to themselves, how do pages share information
    amoung themselves? As in, if my index.aspx has to post data to
    nextpage.aspx, how does it happen? Is it left to the developer to
    persist relevant control values in a state dictionary such as Session
    and read them back in the target/destination page nextpage.aspx?
     
    Water Cooler v2, Sep 3, 2005
    #1
    1. Advertising

  2. That a page should post to itself was an ASP.NET 1.x paradigm.

    In ASP.NET 2.0 you can post to other pages.




    Juan T. Llibre
    ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    ==========================

    "Water Cooler v2" <> wrote in message
    news:...
    > That ASP.NET pages post to themselves, how do pages share information
    > amoung themselves? As in, if my index.aspx has to post data to
    > nextpage.aspx, how does it happen? Is it left to the developer to
    > persist relevant control values in a state dictionary such as Session
    > and read them back in the target/destination page nextpage.aspx?
    >
     
    Juan T. Llibre, Sep 3, 2005
    #2
    1. Advertising

  3. How do we do it while we are using v1.1?
     
    Water Cooler v2, Sep 3, 2005
    #3
  4. The easiest way that I know of is to use a combination of storing your
    value/object in the context object and utilizing Server.Transfer.

    On the page being transferred from:

    Dim MyValue As String = "This is my value to transfer (It could be any
    object).
    Context.Items.Add("MyKey", MyValue)

    Server.Transfer("page2.aspx")

    On page two:

    Dim MyValue AS String = CType(Context.Items.Item("MyKey"), String)

    (Of course Context.Items.Item("MyKey").toString would work better here, but
    I used CType to illustrate that you could place any type of object into the
    context object.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Water Cooler v2" <> wrote in message
    news:...
    > How do we do it while we are using v1.1?
    >
     
    S. Justin Gengo, Sep 3, 2005
    #4
  5. Juan T. Llibre, Sep 3, 2005
    #5
  6. making a database connection

    Hi,
    I am not familiar with th dot net framework. I want to make a SQL connection
    to display the contents of a particular table in a listbox. whenever I try to
    do this an error is shown up that exe file is missing.So anyone cn help me to
    make a database connection and to complie the same..
    Suneethi
     
    =?Utf-8?B?c3VuZWV0aGk=?=, Sep 13, 2005
    #6
  7. Water Cooler v2

    Pat Guest

    Re: making a database connection

    suneethi why don;t u look up this site at :-
    http://www.connectionstrings.com/
    And see how you could connect to SQL server
    Hope that helps
    Patrick


    "suneethi" <> wrote in message
    news:...
    >
    > Hi,
    > I am not familiar with th dot net framework. I want to make a SQL

    connection
    > to display the contents of a particular table in a listbox. whenever I try

    to
    > do this an error is shown up that exe file is missing.So anyone cn help me

    to
    > make a database connection and to complie the same..
    > Suneethi
     
    Pat, Sep 14, 2005
    #7
    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. cgia
    Replies:
    5
    Views:
    792
    Steve C. Orr, MCSD
    Jul 26, 2003
  2. alanb
    Replies:
    2
    Views:
    573
    alanb
    Apr 23, 2004
  3. B
    Replies:
    2
    Views:
    315
    =?Utf-8?B?T3Jlbg==?=
    Oct 19, 2006
  4. AmitKu
    Replies:
    7
    Views:
    581
    John Timney \(MVP\)
    Jan 8, 2007
  5. Avlan
    Replies:
    3
    Views:
    112
Loading...

Share This Page