FAQ Database Discussion Community


Trigger a js function with parameter from code behind

c#,jquery,asp.net,scriptmanager,registerstartupscript
C# Trigger a js function with parameter from code behind. I have the following code: C#: ScriptManager.RegisterStartupScript(this, this.GetType(), "ScriptManager1", String.Format(@"ShowHideMessageBlock('{0}')", @"#successMsg"), true); js: function ShowHideMessageBlock(xid) { var c = xid; console.log(c); $(c).fadeIn('slow', function () { $(this).delay(5000).fadeOut('slow'); }); } When I open the console window I get the following message: Uncaught...

RegisterStartupScript not firing off JScript method

javascript,jquery,asp.net,registerstartupscript
I can't seem to figure out how to fire off a javascript function from my code-behind. Here is my javascript in my aspx page... <script type="text/javascript"> ... function HidePopup() { $(function() { $("#popup").dialog("close"); }); }); I have a similar function called ShowPopup that is fired for the OnClientClick event of...