Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to call a java script function from code behind some button click condition?
    text
    copied!<p>i want to open a model pop up on some button click in code behind which has got a few if else condition. First of all i am unable to fix what would be best approach. What i options i think are followign. 1) calling a jquery model pop up 2) ajax model pop up</p> <p>It is a button which fix on some button click condition to open the model pop up, if model pop says yes then, i want client to rediret to some payemnt page where he will pay to purchase the item.</p> <p>Right now i am using the Jquery model pop up which i am calling like this</p> <pre><code> protected void imgClientFreeEval_Click(object sender, System.Web.UI.ImageClickEventArgs e) { ----- ---some code not typed if (SurveyCount &gt; 1) { Session["YourAssessment"] = true; Session["MyAssessment"] = false; ScriptManager.RegisterStartupScript(this, this.GetType(), "tmp", "&lt;script&gt;xyz()&lt;/script&gt;", true); //Response.Redirect("~/yourAssessment.aspx"); } } </code></pre> <p>and i have model pop up like this</p> <pre><code> function xyz() { // alert('hi tpo all'); // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore! // $("#dialog:ui-dialog").dialog("destroy"); $(document).ready(function () { $("#dialog-confirm").dialog({ resizable: false, height: 140, modal: true, autoOpen: false, buttons: { "OK": function () { $(this).dialog("close"); window.location.replace("http://stackoverflow.com"); }, Cancel: function () { window.location.replace("http://stackoverflow.com"); $(this).dialog("close"); } } }); }); } </code></pre> <p>Now the problem is that this function not getting called at all. what is wrong with this, i am toiling for long, if possible please suggest me best approach how should i execute it. i am unable to call this javasccipt function from code behind button click.</p>
 

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