TextBox set to Readonly loses value

Discussion in 'ASP .Net' started by Doogie, Aug 11, 2009.

  1. Doogie

    Doogie Guest

    I have a textbox that I have set to Readonly. This textbox loses it's
    value on post back. Setting autopostback = true doesn't keep the
    value. How do I keep the value?
    Doogie, Aug 11, 2009
    #1
    1. Advertising

  2. Doogie

    Stan Guest

    On 11 Aug, 22:11, Doogie <> wrote:
    > I have a textbox that I have set to Readonly.  This textbox loses it's
    > value on post back. Setting autopostback = true doesn't keep the
    > value.  How do I keep the value?


    Is EnableViewState set to true for the control?
    Stan, Aug 11, 2009
    #2
    1. Advertising

  3. Doogie

    Doogie Guest

    On Aug 11, 4:41 pm, Stan <> wrote:
    > On 11 Aug, 22:11, Doogie <> wrote:
    >
    > > I have a textbox that I have set to Readonly.  This textbox loses it's
    > > value on post back. Setting autopostback = true doesn't keep the
    > > value.  How do I keep the value?

    >
    > Is EnableViewState set to true for the control?


    Unfortunately we have specific standards in our company that prevent
    us from using ViewState (I hate it but it's true). Is that the only
    way?
    Doogie, Aug 11, 2009
    #3
  4. Doogie

    Stan Guest

    On 11 Aug, 22:44, Doogie <> wrote:
    > On Aug 11, 4:41 pm, Stan <> wrote:
    >
    > > On 11 Aug, 22:11, Doogie <> wrote:

    >
    > > > I have a textbox that I have set to Readonly.  This textbox loses it's
    > > > value on post back. Setting autopostback = true doesn't keep the
    > > > value.  How do I keep the value?

    >
    > > Is EnableViewState set to true for the control?

    >
    > Unfortunately we have specific standards in our company that prevent
    > us from using ViewState (I hate it but it's true).  Is that the only
    > way?


    How about Session? As far as I know Session states are maintained on
    the server rather than the client so may be more acceptable if that's
    the basis of the objection.
    Stan, Aug 11, 2009
    #4
  5. Doogie

    Doogie Guest

    On Aug 11, 4:59 pm, Stan <> wrote:
    > On 11 Aug, 22:44, Doogie <> wrote:
    >
    > > On Aug 11, 4:41 pm, Stan <> wrote:

    >
    > > > On 11 Aug, 22:11, Doogie <> wrote:

    >
    > > > > I have a textbox that I have set to Readonly.  This textbox loses it's
    > > > > value on post back. Setting autopostback = true doesn't keep the
    > > > > value.  How do I keep the value?

    >
    > > > Is EnableViewState set to true for the control?

    >
    > > Unfortunately we have specific standards in our company that prevent
    > > us from using ViewState (I hate it but it's true).  Is that the only
    > > way?

    >
    > How about Session? As far as I know Session states are maintained on
    > the server rather than the client so may be more acceptable if that's
    > the basis of the objection.


    I believe both are restricted unfortuantely. I"ll do some checking on
    that. Thank you!
    Doogie, Aug 12, 2009
    #5
  6. Doogie

    E-ric

    Joined:
    Oct 10, 2012
    Messages:
    1
    instead of making the textbox readonly using properties option... write the code...

    instead of making the textbox readonly using properties option... write the code...


    Code:
    TextBox1.Attributes.Add("readonly", "readonly");
    E-ric, Oct 10, 2012
    #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. Dot Net Work
    Replies:
    2
    Views:
    687
    Dot Net Work
    Sep 20, 2006
  2. Bhagya

    Password TextBox loses value

    Bhagya, Nov 22, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    626
    Edwin Knoppert
    Nov 23, 2006
  3. Keith-Earl
    Replies:
    5
    Views:
    179
  4. Jonathan Hyatt
    Replies:
    1
    Views:
    1,912
    Jonathan Hyatt
    Jun 8, 2004
  5. ErwinP
    Replies:
    1
    Views:
    737
    ErwinP
    Aug 19, 2005
Loading...

Share This Page