I cant get my dialog to close, what am I doing wrong here? I am trying to integrate this script in my asp.net mvc 3 app?
<p id="dialog_link" style="cursor: pointer;">
Open Dialog
</p>
<div id="Dialog" title="Dialog title!" style="display: none;">
@* @{Html.RenderAction("Categories");}*@
@{Html.RenderAction("About");}
</div>
<link href="../../Content/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript">
</script>
<script type language="javascript">
$(function () {
var execute = function () {
//alert('This is Ok button');
};
var cancel = function() {
//alert('This is Cancel button');
$("#Dialog").dialog('close');
};
var dialogOpts = {
buttons: {
"Ok": execute,
"Cancel": cancel
}
};
$("#Dialog").dialog(dialogOpts);
});
</script>