|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OnTextChanged Event for a label controlHello
Is there an equivalent of a OnTextChangedEvent for a asp: label control in asp.Net 2.0. Every time the text of a label changes, I want the items in a listbox control cleared. TIA Sue.. Since ASP.NET controls are rendered to the client as HTML (in this case, a
<SPAN> tag), you need to be thinking about what client-side event would work for you, the server-side events are only triggered if a postback is initiated. So, you should add this to your asp:label control via the page_load() event handler: lblSomething.attributes.add("onChange","clientSideFunction()") And then add a client-side function that matches the second parameter you gave above that does the clearing of the listbox data. Show quote "Sue" <iyer_san***@hotmail.com> wrote in message news:1173817214.930941.50530@e65g2000hsc.googlegroups.com... > Hello > > Is there an equivalent of a OnTextChangedEvent for a asp: label > control in asp.Net 2.0. Every time the text of a label changes, I want > the items in a listbox control cleared. > > TIA > Sue.. > |
|||||||||||||||||||||||