Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I converted my (working) web application from VS2003 (.NET 1.1) to VS2008(.NET 3.5, ASP.NET 2.0) and I'm experiencing the next problem: the textbox text which was changed on the client side, arrives without changes to the server side. The textbox is located in a user control.

When looking into Request.Form[...] I see the right (changed) text, but when looking into control itself it is not changed.

Any ideas? Any differences with ViewState / Postback?

How come there is a difference between Request.Form[..] and the control itself on the server side?
Posted
Updated 2-Dec-09 3:55am
v4

1 solution

Have you disabled the control in the server side .. .??
Means you mentioned

textbox.Enabled = false;

Or made ReadOnly means

textbox.ReadOnly = true;

??

ASP.NET do not make any changes to the viewstate whenever a control is set Readonly or Disabled from the server side.

So use

textbox.Attributes.Add("readonly", "readonly");

I think this might be the reason. :rose:
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900