Hi guys, I have this label that i want to fadeOut after button event clicked. I am using a MasterPage. And the Script Manager is declared on MasterPage. In Defaulst.aspx i have:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="Server">
<script type="text/javascript" src="scripts/jquery-1.4.1.min.js">
$(function () {
$("input[id$='btnShowDate']").click(function () {
$("span[id$='lblStatus']").fadeOut("slow");
});
});
</script>
<asp:UpdatePanel runat="server" ID="uP">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnShowDate" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" ID="lblStatus" />
<div>
<asp:Button runat="server" ID="btnShowDate" Text="Show Today`s Date" OnClick="btnShowDate_Click" /></div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
And on the CodeBehind i have:
protected void btnShowDate_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
lblStatus.Text = DateTime.Now.Date;
}
The problem is that the label is not fading Out after the button clicked. Does someone has any idea on how to handle this problem? Thank you.