65.9K
CodeProject is changing. Read more.
Home

Disable Label after some amount of time

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Jan 24, 2012

CPOL
viewsIcon

8730

Achieve the same using AJAX AnimationExtender control. Use the below code: ...

Achieve the same using AJAX AnimationExtender control. Use the below code:
<asp:updatepanel id="upnl" runat="server" xmlns:asp="#unknown">
    <contenttemplate>
         <asp:label id="lbl" runat="server" cssclass="fadeLabel"></asp:label>
    </contenttemplate>
</asp:updatepanel>

<asp:updatepanelanimationextender id="upax" runat="server" behaviorid="animation" targetcontrolid="upnl" xmlns:asp="#unknown">
    <animations>
        <onupdated>  
            <sequence>  
                <ScriptAction Script="fadeOut()" />
            </sequence>  
        </onupdated>   
    </animations>  
</asp:updatepanelanimationextender>
in your code behind.
lbl.Text = "Assign Text";
upnl.Update();
Fadeout method:
function BannerOut() {
    $(".fadeLabel").fadeOut(1000);
}
Thanks --RA