Wednesday, March 28, 2012

Change className with AnimationExtender

I have been trying to use ScriptAction to change the class

<ajaxToolkit:AnimationExtender ID="webAni" runat="server" TargetControlID="webBut">
<Animations>
<OnClick>
<Sequence>
<ScriptAction Script="document.getElementById('webBut').className='servSel';" />
<StyleAction AnimationTarget="infoHolder" Attribute="display" Value="block" />
</Sequence>
</OnClick>
</Animations>
</ajaxToolkit:AnimationExtender>

This does not work.

I also tried <ScriptAction Script="alert(document.getElementById('webBut').className);" /> to see if it returns name of class. No box appears. Oh and also tried using $get('webBut').className='servSel';

Any ideas? What am i doing wrong?


Rick

I figured it out. The page has a masterpage and the id was changed.

No comments:

Post a Comment