TextBox set to Readonly loses value

D

Doogie

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?
 
S

Stan

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?
 
D

Doogie

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?
 
S

Stan

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.
 
D

Doogie

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!
 
Joined
Oct 10, 2012
Messages
1
Reaction score
0
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");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top