Diff Between Textbox.value and Textbox.Text
Diff Between Textbox.value and Textbox.Text?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manas MohapatraPosted Aug 17, 2016, 2:22 AM
Soumalya DasPosted Aug 17, 2016, 1:57 AM
Vinay SinghPosted Aug 17, 2016, 12:49 AM
When you add properties that don't exists in the TextBox class, asp.net will render those properties to the resulting html. So
Will render to something like this
If you omit the
TextBox'sTextproperty and write the value property, then the value property will be rendered.To
TextBox doesn't has a Value property. When the TextBox instance is created, the HTML value property will be assigned to the Text property, and that's why you access the Text property it has the "aaaa" value.
Summary: Don't use value property when you use ASP.NET controls. Use the controls specific properties.
Jisny AvPosted Aug 17, 2016, 12:33 AM
Rajeesh MenothPosted Aug 5, 2016, 9:53 AM