Retrieving changed TextBox values

Discussion in 'ASP .Net Web Controls' started by Jon J., Sep 16, 2004.

  1. Jon J.

    Jon J. Guest

    Hi everyone,

    When I change the original value at runtime in a TextBox control, and then
    try to retrieve this new value from a Button.OnClick event, I instead get the
    original TextBox.Text value.

    Has anyone seen this before or know what might be happening?

    Thanks,
    --
    Jon
     
    Jon J., Sep 16, 2004
    #1
    1. Advertising

  2. Hi,

    Check if the AutoPostBack property of the Textbox is false. If it is
    true then make it false.

    --
    Tarkeshwar
    CCIE Q(Routing and Switching)
    Fifth Generation Technologies

    "Jon J." <.(spamless)> wrote in message
    news:D...
    > Hi everyone,
    >
    > When I change the original value at runtime in a TextBox control, and then
    > try to retrieve this new value from a Button.OnClick event, I instead get

    the
    > original TextBox.Text value.
    >
    > Has anyone seen this before or know what might be happening?
    >
    > Thanks,
    > --
    > Jon
     
    Tarakeshwar L, Sep 16, 2004
    #2
    1. Advertising

  3. Jon J.

    Jon J. Guest

    Thanks, but I did not change the default, which is false, so that is not it.
    - J.

    "Tarakeshwar L" wrote:

    > Hi,
    >
    > Check if the AutoPostBack property of the Textbox is false. If it is
    > true then make it false.
    >
    > --
    > Tarkeshwar
    > CCIE Q(Routing and Switching)
    > Fifth Generation Technologies
    >
    > "Jon J." <.(spamless)> wrote in message
    > news:D...
    > > Hi everyone,
    > >
    > > When I change the original value at runtime in a TextBox control, and then
    > > try to retrieve this new value from a Button.OnClick event, I instead get

    > the
    > > original TextBox.Text value.
    > >
    > > Has anyone seen this before or know what might be happening?
    > >
    > > Thanks,
    > > --
    > > Jon

    >
    >
    >
     
    Jon J., Sep 16, 2004
    #3
  4. Jon J.

    Ken Nicely Guest

    Are you loading the initial value when the page loads? If so, it could be
    getting reset when the page posts back, because the on_click will not fire
    until after the page load when the page is posted back. If this is the case,
    make sure your intitial setting is of the textbox value is inside an If not
    postback...end if construct.

    Ken

    "Jon J." wrote:

    > Hi everyone,
    >
    > When I change the original value at runtime in a TextBox control, and then
    > try to retrieve this new value from a Button.OnClick event, I instead get the
    > original TextBox.Text value.
    >
    > Has anyone seen this before or know what might be happening?
    >
    > Thanks,
    > --
    > Jon
     
    Ken Nicely, Sep 20, 2004
    #4
  5. Jon J.

    Michael Guest

    Add this to page_load:
    PasswordField.Attributes.Add("value", "secret")

    Here's a link..

    http://www.devx.com/vb2themax/Tip/18887


    "Jon J." <.(spamless)> wrote in message
    news:D...
    > Hi everyone,
    >
    > When I change the original value at runtime in a TextBox control, and then
    > try to retrieve this new value from a Button.OnClick event, I instead get

    the
    > original TextBox.Text value.
    >
    > Has anyone seen this before or know what might be happening?
    >
    > Thanks,
    > --
    > Jon
     
    Michael, Nov 8, 2004
    #5
  6. Jon J.

    Michael Guest

    Please ignore this as it has nothing to do with your question. I had too
    many windows open and replied to the wrong msg..Sorry.

    "Michael" <xxx.xxx.xxx> wrote in message
    news:...
    > Add this to page_load:
    > PasswordField.Attributes.Add("value", "secret")
    >
    > Here's a link..
    >
    > http://www.devx.com/vb2themax/Tip/18887
    >
    >
    > "Jon J." <.(spamless)> wrote in message
    > news:D...
    > > Hi everyone,
    > >
    > > When I change the original value at runtime in a TextBox control, and

    then
    > > try to retrieve this new value from a Button.OnClick event, I instead

    get
    > the
    > > original TextBox.Text value.
    > >
    > > Has anyone seen this before or know what might be happening?
    > >
    > > Thanks,
    > > --
    > > Jon

    >
    >
     
    Michael, Nov 9, 2004
    #6
    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. John
    Replies:
    2
    Views:
    1,552
    Darren Kopp
    Oct 9, 2005
  2. Replies:
    1
    Views:
    698
    Rosanne
    Oct 11, 2005
  3. =?Utf-8?B?RGFuIFNpa29yc2t5?=

    HOWTO: Detect FormView EditItemTemplate TextBox Value Changed

    =?Utf-8?B?RGFuIFNpa29yc2t5?=, Oct 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    679
    =?Utf-8?B?RGFuIFNpa29yc2t5?=
    Oct 4, 2006
  4. greenb
    Replies:
    1
    Views:
    131
    Michael Baltic
    Jul 6, 2005
  5. mxbrunet
    Replies:
    1
    Views:
    221
Loading...

Share This Page