I am calling a jquery function after inserting a record to database...
ScriptManager.RegisterClientScriptBlock(LbOk, typeof(LinkButton), "json",
"topBar('Successfully Inserted');", true);
I have included this in my master page for executing jquery function after a postback,
<script type="text/javascript">
function load() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
function EndRequestHandler()
{
topBar(message);
}
function topBar(message) {
alert(a);
var alert = $('<div id="alert">' + message + '</div>');
$(document.body).append(alert);
var $alert = $('#alert');
if ($alert.length) {
var alerttimer = window.setTimeout(function() {
$alert.trigger('click');
}, 5000);
$alert.animate({ height: $alert.css('line-height') || '50px' }, 200).click(function() {
window.clearTimeout(alerttimer);
$alert.animate({ height: '0' }, 200);
});
}
}
</script>
<body onload="load();">
But it doesn't seem to work... Any suggestion..
alert
as a local variable. window.alert() won't be redefined. – Bullockalert($)
beforealert(a)
what happens? – Silicium