I would like to fadein and out a div after performing some code. This JQuery function is working fine when using the button's onclientclick property. But, Unable to call it from c#.
JS:
function Confirm()
{
$(".saved").fadeIn(500).fadeOut(500);
}
C#:
protected void btnsave_click(object sender, Eventargs e)
{
//some code
upd.update();
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Confirm",
"<script type='text/javascript'>Confirm();</script>", true);
}
HTML:
<asp:updatepanel id="upd" runat="server" updatemode="conditional">
<triggers>
<asp:asyncpostbacktrigger controlid="btnsave" eventname="click"/>
</triggers>
<contenttemplate>
<div style="position:relative">
<span class="saved">Record Saved</span>
<asp:gridview....../>
</div>
<asp:button id="btnsave" runat="server" text="save" onclick="btnsave_click"/>
</contenttemplate>
</asp:updatepanel>
CSS:
.saved
{
position:absolute;
background:green;
margin:0 auto;
width:100px;
height:30px;
visibility:hidden;
}