Reputation: 12843
I wrote this javascript Function :
function ShowMsg(msg) {
$.blockUI({
message: '<div dir=rtl align=center><h1><p>' + msg + '</p></h1></div>',
css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
}
});
setTimeout($.unblockUI, 2000);
}
i want to call this Function Server Side at asp.net :
Page.ClientScript.RegisterClientScriptBlock([GetType](), "script", "ShowMsg(" & "Saved" & ");", True)
But it does not work. the function is work without argument. is there any syntax error exist? thanks
Upvotes: 0
Views: 4071
Reputation: 458
These kind of errors you can check through javascript debugging. to enable javascript debugging. go to : tools > intenet options > advanced > browsing and uncheck (disable script debugging). in Internet Explorer Browser . then you can attach debugger by writing debugger; @ any location in javascript function egs:
function ShowMsg(msg) { *
* $.blockUI({ message: '
' + msg + '
', css: { border: 'none', padding: '15px', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .5, color: '#fff' } }); setTimeout($.unblockUI, 2000);
}
Upvotes: 1
Reputation: 5358
'Saved' parameter is missing the quotes
Page.ClientScript.RegisterClientScriptBlock([GetType](), "script", "ShowMsg('" & "Saved" & "');", True)
Upvotes: 2