|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TextBox TextChanged EventHi 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 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 > 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 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 >
ValidationControl evaluationfunction ASP.NET 2.0
Adding WebControl using a Button.... Custom Controls with non-String Attributes Responding to changes to controls in a Repeater Response.Redirect not being called after sending an email Web control which is a combobox with an editable portion XML Dropdownlist- Custom DataTextField asp.net 1.1 X 2.0 compatibility issue how to trigger an action by clicking in a field of detailsview? Anyway to enable a ToolTip for each ListItem |
|||||||||||||||||||||||