Hi,
I took the sample how to create control that itherits from Sys.UI.Control here
http://asp.net/AJAX/Documentation/Live/tutorials/CreatingCustomClientControlsTutorial.aspx
and I modified the script so that it contains a default value for the "id" property, according to the sample here
http://asp.net/AJAX/Documentation/Live/ClientReference/Sys/ComponentClass/ComponentCreateMethod.aspx
$create(Demo.HoverButton, {id:'testId',text: 'A HoverButton Control',element: {style: {fontWeight: "bold", borderWidth: "2px"}}}, {click: start, hover: doSomethingOnHover, unhover: doSomethingOnUnHover},null, $get('Button1'));
you can find the whole code I used at
http://www.ninebytes.com-a.googlepages.com/DemoHoverButton.aspx.htm
http://www.ninebytes.com-a.googlepages.com/HoverButton.js.htm
or ZIPped
http://www.ninebytes.com-a.googlepages.com/DemoHoverButton.zip
However, I am getting an error "Sys.InvalidOperationException: Operation is not vallid due to the current state of the object."
I think this must be a bug in the framework, as the code is according to the documentation.
Or, does anyone know about another way how to set the "id" property of the control?
(Sys.UI.Behavior works fine)
best regards
Miroslav
[Noelle Mallory - MSFT] Please post questions to the MSDN Forums at http://forums.microsoft.com/msdn. You will likely get a quicker response through the forum than through the Community Content.