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
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.
Right now i am using the Jquery model pop up which i am calling like this
protected void imgClientFreeEval_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
-----
---some code not typed
if (SurveyCount > 1)
{
Session["YourAssessment"] = true;
Session["MyAssessment"] = false;
ScriptManager.RegisterStartupScript(this, this.GetType(), "tmp", "<script>xyz()</script>", true);
//Response.Redirect("~/yourAssessment.aspx");
}
}
and i have model pop up like this
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");
}
}
});
});
}
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.