Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > TextBox set to Readonly loses value

Reply
Thread Tools

TextBox set to Readonly loses value

 
 
Doogie
Guest
Posts: n/a
 
      08-11-2009
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?
 
Reply With Quote
 
 
 
 
Stan
Guest
Posts: n/a
 
      08-11-2009
On 11 Aug, 22:11, Doogie <dnlwh...@dtgnet.com> 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?
 
Reply With Quote
 
 
 
 
Doogie
Guest
Posts: n/a
 
      08-11-2009
On Aug 11, 4:41*pm, Stan <googles...@philhall.net> wrote:
> On 11 Aug, 22:11, Doogie <dnlwh...@dtgnet.com> 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?
 
Reply With Quote
 
Stan
Guest
Posts: n/a
 
      08-11-2009
On 11 Aug, 22:44, Doogie <dnlwh...@dtgnet.com> wrote:
> On Aug 11, 4:41*pm, Stan <googles...@philhall.net> wrote:
>
> > On 11 Aug, 22:11, Doogie <dnlwh...@dtgnet.com> 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.
 
Reply With Quote
 
Doogie
Guest
Posts: n/a
 
      08-12-2009
On Aug 11, 4:59*pm, Stan <googles...@philhall.net> wrote:
> On 11 Aug, 22:44, Doogie <dnlwh...@dtgnet.com> wrote:
>
> > On Aug 11, 4:41*pm, Stan <googles...@philhall.net> wrote:

>
> > > On 11 Aug, 22:11, Doogie <dnlwh...@dtgnet.com> 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!
 
Reply With Quote
 
E-ric E-ric is offline
Junior Member
Join Date: Oct 2012
Posts: 1
 
      10-10-2012
instead of making the textbox readonly using properties option... write the code...


Code:
TextBox1.Attributes.Add("readonly", "readonly");
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
textbox in repeater loses value between postback Dot Net Work ASP .Net 2 09-20-2006 02:09 PM
Getting viewstate value from readonly textbox in .NET2 (VB) ShaneFowlkes ASP .Net 9 04-12-2006 05:51 PM
ASP.NET textbox loses text value in composite control but Textbox subclass doesn't!? ErwinP ASP .Net Web Controls 1 08-19-2005 01:50 PM
CType(e.Item.Cells(3).Controls(1), textbox) fails when key is set to READONLY Keith-Earl ASP .Net Datagrid Control 5 07-15-2004 01:50 PM
ASP.NET Readonly panel function with readonly checkbox, readonly radiobutton Jonathan Hyatt ASP .Net Web Controls 1 06-08-2004 07:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57