how to return true or false when I click on confirm dialog button?
<p>I have a jquery</p>

<pre><code>$(function () {
    $('.checked').click(function (e) {
        e.preventDefault();
        var dirtyvalue = "Test1";
        var textvalue= "Test";

        if (dirtyvalue.toLowerCase() != textvalue.toLowerCase()) {

            {
                var dialog = $('&lt;p&gt;Do you want to save your changes?&lt;/p&gt;').dialog({
                    buttons: {
                        "Yes": function () {
                            dialog.dialog('close');
                            alert('yes btn called');

                        },
                        "No": function () {
                            dialog.dialog('close');
                            alert('No btn called');

                        },
                        "Cancel": function () {
                            dialog.dialog('close');

                        }
                    }
                });
            }
            return false;
        }
        return true;

    });
});
</code></pre>

<p>I want to to return true or false on button click, yes will return true, No will return true and Cancel will return false. </p>

<p>I already check this <a href="http://stackoverflow.com/questions/6049687/jquery-ui-dialog-box-need-to-return-value-when-user-presses-button-but-not-wor">link</a> but this is not solving my problem.
my previous <a href="http://stackoverflow.com/questions/9091001/how-to-show-confirmation-alert-with-three-buttons-yes-no-and-cancel-as-it/9091077#comment11456137_9091077">qus.</a></p>

<p>My problem is I have many ActionLink and TreeView links, on which I am calling there respective page, Suppose I am on page1 where I have all these js, and on that page1 and have many action link and clicking on page2, at that time my confirm will open and when i'll click on button No it will redirect to page2.</p>

<p>please someone help me...</p>
