I am trying to open asp.net mvc view in jquery dialog.
Here is my view from where i am trying to open dialog:
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function () {
$('#my-dialog').dialog({
autoOpen: false,
width: 400,
resizable: false,
modal: true
});
$('.modal').click(function () {
$('#my-dialog').load(this.href, function () {
$(this).dialog('open');
});
return false;
});
});
</script>
<div id="my-dialog"></div>
@Html.ActionLink("Add Question", "AddQuestionInPage", new { pageID = @ViewBag.PageID },new { @class = "modal" })
But it shows this error in console:
Uncaught TypeError: undefined is not a function
It show the error on this line:
$(this).dialog('open');
What is going wrong? why dialog is undefined as i have added jquery-ui file. Plz guide me, Thanx