Retrieve value of an asptextbox

Discussion in 'ASP .Net' started by Michael, Jun 25, 2008.

  1. Michael

    Michael Guest

    I am using Web Developer Express 2005. I created a little form to add
    some content to a database. I keep the formview default mode in the
    insert mode. The values are being added to the database fine.

    How do I retrieve a value of one of the textboxes and assign it to a
    variable so I can pass it along to a new page after the insert event?

    Thanks
     
    Michael, Jun 25, 2008
    #1
    1. Advertising

  2. Michael

    Michael Guest

    Mark,

    Dont I have to use some type of findcontrol method ?

    Thanks
     
    Michael, Jun 25, 2008
    #2
    1. Advertising

  3. Michael

    Hans Kesting Guest

    After serious thinking Michael wrote :
    > I am using Web Developer Express 2005. I created a little form to add
    > some content to a database. I keep the formview default mode in the
    > insert mode. The values are being added to the database fine.
    >
    > How do I retrieve a value of one of the textboxes and assign it to a
    > variable so I can pass it along to a new page after the insert event?
    >
    > Thanks


    If you want to "pass variables to another page", then a regular
    variable is not enough: After a redirect to that other page all your
    variables are cleared.
    But this is a very common situation, so there is a common solution:
    store the values in Session.

    example in C#:

    Session["MyValue"] = "Some Value";

    string s = (string)Session["MyValue"];

    Note: everything is stored as "object", so you need to cast to the
    proper type.


    Hans Kesting
     
    Hans Kesting, Jun 25, 2008
    #3
    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. chanmm
    Replies:
    1
    Views:
    348
    Natty Gur
    Aug 26, 2003
  2. Softwaremaker
    Replies:
    2
    Views:
    499
    Rajesh.V
    Oct 27, 2003
  3. David J Duryea

    VB Newbie, Retrieve Listbox value from Control

    David J Duryea, Jan 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,498
    Natty Gur
    Jan 27, 2004
  4. Cipher
    Replies:
    1
    Views:
    3,560
    Natty Gur
    Jul 11, 2004
  5. Mariame

    Retrieve a value from a Hyperlink

    Mariame, Jul 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    340
    Eliyahu Goldin
    Jul 28, 2004
Loading...

Share This Page