Click here to Skip to main content
15,885,546 members
Articles / Web Development / ASP.NET
Alternative
Tip/Trick

Disable Label after some amount of time

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
8 Feb 2012CPOL 8.5K   1
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.
C#
lbl.Text = "Assign Text";
upnl.Update();


Fadeout method:
C#
function BannerOut() {
    $(".fadeLabel").fadeOut(1000);
}


Thanks
--RA

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralThanks Deeksha --RA Pin
Rajesh Anuhya8-Feb-12 18:42
professionalRajesh Anuhya8-Feb-12 18:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.