Home All Groups Group Topic Archive Search About
Author
25 Jun 2006 6:57 AM
sunilthk
Hi All,
I want to know how the TextBox control knows that it's data has been
changed, since it is able to detect changes and fires TextChange event
if the data in the TextBox has been changed. I know that TextBox class
implements IPostBackDataHandler interface which defines a method
LoadPostData(string postDataKey,NameValueCollection postCollection)
the postCollection keeps the posted data for each web control. How
ASP.NET fills this postCollection objects, i thought that ASP.NET uses
view state to get posted values, but i set EnableViewState property of
the text box=false then also the text changed event is firing.
In other words in order to detect whether the TextBox's data has been
changed
you must know the old value and new value, so how ASP.NET knows the
last posted value even if View State is disabled for the TextBox.
Please let me know how this happens.
Thanks
Sunil

Author
25 Jun 2006 11:48 AM
Alessandro Zifiglio
hi Sunil,
with viewstate disabled, the textbox does not know if the text has changed
or not. It just fires the ontextchanged event regardless, whether the text
changed or not. With viewstate enabled it compares old and new value and
then fires the textchanged event only if the text has changed.
Regards,
Alessandro Zifiglio
<sunil***@gmail.com> ha scritto nel messaggio
Show quoteHide quote
news:1151218655.611272.245030@i40g2000cwc.googlegroups.com...
> Hi All,
> I want to know how the TextBox control knows that it's data has been
> changed, since it is able to detect changes and fires TextChange event
> if the data in the TextBox has been changed. I know that TextBox class
> implements IPostBackDataHandler interface which defines a method
> LoadPostData(string postDataKey,NameValueCollection postCollection)
> the postCollection keeps the posted data for each web control. How
> ASP.NET fills this postCollection objects, i thought that ASP.NET uses
> view state to get posted values, but i set EnableViewState property of
> the text box=false then also the text changed event is firing.
> In other words in order to detect whether the TextBox's data has been
> changed
> you must know the old value and new value, so how ASP.NET knows the
> last posted value even if View State is disabled for the TextBox.
> Please let me know how this happens.
> Thanks
> Sunil
>
Author
26 Jun 2006 7:09 AM
sunilthk
Hi Alessandro,
You are right, i've checked that (as you said)  if view state is
disabled TextChanged event fires if text is changed or not.
Thanks alot for clearing my doubt. So it means ASP.NET uses ViewState
to get posted values ?
Thanks
Sunil
Author
26 Jun 2006 7:14 AM
Alessandro Zifiglio
yes Sunil, asp.net stores the old value in viewstate, while getting the new
value via http post through the form object collection.
regards,
Alessandro.
<sunil***@gmail.com> ha scritto nel messaggio
Show quoteHide quote
news:1151305770.624900.199540@u72g2000cwu.googlegroups.com...
>
> Hi Alessandro,
> You are right, i've checked that (as you said)  if view state is
> disabled TextChanged event fires if text is changed or not.
> Thanks alot for clearing my doubt. So it means ASP.NET uses ViewState
> to get posted values ?
> Thanks
> Sunil
>