TextBox and DropDownList - original value

  • Thread starter Thread starter Marcus Phass
  • Start date Start date
M

Marcus Phass

When I am in TextChanged event handler, how can I find out what was the
original value of that TextBox (before it was changed)? And the same
question for DropDownList? Viewstate is enabled, of course.
 
Try either setting an invisible literal next to the textbox or dropdown
contraining its original value,
or you can save the initial value to viewstate when the page loads.
i,e,
ViewState["TBValue"] = "some value";
 
GrantMagic said:
Try either setting an invisible literal next to the textbox or dropdown
contraining its original value,
or you can save the initial value to viewstate when the page loads.
i,e,
ViewState["TBValue"] = "some value";

Thanks, but I think that MS's aproach to this issue is a design flaw!
Because, when values are posted back, the original value is posted
automatically in the viewstate (hidden field), and the modified value is
posted back too in its own field. So there should be no need to manually
fill the viewstate information nor to use the additional hidden field
because these values should be both available automatically. :-(((
 
Back
Top