Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling JavaScript function from server-side?
    primarykey
    data
    text
    <p>So this seems famous, but with little different. </p> <p><strong>JavaScript Function:</strong></p> <pre><code>function ShowMessage(Message, Title, isAlarm) { $("#dtext").html(Message); $("span.ui-dialog-title").text(Title); $("#dialog").dialog({ open: function(e) { var Dia = $(e.target); if (isAlarm == true) { Dia.parents(".ui-dialog:first").find(".ui-dialog-titlebar").css("background", "red"); Dia.parents(".ui-dialog:first").find(".ui-dialog-titlebar").css("color", "White"); } else { Dia.parents(".ui-dialog:first").find(".ui-dialog-titlebar").css("background", "LightSeaGreen"); Dia.parents(".ui-dialog:first").find(".ui-dialog-titlebar").css("color", "White"); } }, show: "blind", hide: "clip", modal: true, resizable: false, buttons: { "Close": function(e) { $(this).dialog("close"); return true; } } }); } </code></pre> <p>As you see this method fill with Jquery-Code. if this is just java-script, We can use this Code to call that function but in this case this method don't work well.</p> <p><strong>C# calling JS Method:</strong></p> <pre><code> if (!Pointer.ClientScript.IsStartupScriptRegistered("message")) Pointer.Page.ClientScript.RegisterStartupScript (Pointer.Master.GetType(), "message", "ShowMessage('messageBox','" + Message + "',false);", true); </code></pre> <p>I don't Know how to resolve this problem. <em><code>I Want just call this Js function from server-side?</code></em></p> <blockquote> <p><em><strong>Edit 1</em></strong></p> </blockquote> <p>Thank for your attention. some guy's want from me describe my problem better. Why I can't ? Cuz <code>I don't know what's exactly problem</code>.</p> <p>I just can say, I test this program with FireBug and set break-point on first line on JS function but in run time when I call that Js function that break-point <code>Hit</code> for a few Millisecond and then page reload goes complete and nothing happened. </p> <blockquote> <p>I'm newbie on JS and jQuery. So Instead hitting down vote plz <em>try sample program with these Code's and help Me</em>. </p> </blockquote> <p>thank Again (specially Stefan, PirateKitten, Widor)</p> <blockquote> <p><em><strong>Edit 2</em></strong> </p> </blockquote> <p>I made this <code>Function(JQuery Message Function)</code> to replace <strong><code>Old Function</code></strong> which only use simple JS alert. and I must say old version work(even if I call that from server-side with JS-Caller-Function I write).</p> <p>in this case, even if <em><code>I call new Function(JQ Function) with Js</code></em> in page like :</p> <pre><code>&lt;button type="button" onclick="ShowMessage('hi','title',false)"&gt; Display Message &lt;/button&gt; </code></pre> <p>It's worked, But <strong><code>when call that from server side, Function don't work</code></strong>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload