(Christer)
1/21/2003 10:11:00 PM
Hi all!
I'm a situation, where I want to inherit from
System.Web.UI.Webcontrols.Textbox. In this new inherited textbox, I
want to add some javascript code on the onFocus event. No problem, I
do so by using AddAttribute on the HTMLTextWriter before rendering my
base class.
Now, I want create yet another textbox, that extends my new textbox
with more functionality... but, the functionality also uses onFocus.
So, I have use AddAttribute in this scope too.
The inheritance result is this
System.Web.UI.Webcontrols.Textbox -> MyTextBox1 (adds OnFocus script)
-> MyTextBox1 (adds (more) OnFocus script)
When I do this, it results in TWO onFocus attributes in the html
output. Does any of you know how to "append" to an existing attribute,
if it exists among the attributes, that haven't been written to a html
element yet? The situation above is simplified - the real one
justifies that the two are not implemented in the same class.
Thanks in advance.
Christer