0x800a139e - JavaScript runtime error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

I have cancel button that is not working properly on a JQuery Modal Dialog and I would really appreciate some help. This is the exception I'm getting when I click on the cancel button of the modal: > 0x800a139e - JavaScript runtime error: cannot call methods on dialog > prior to initialization; attempted to call method 'close' This is the partial view I'm displaying on the modal: @model Models.Office @{ Layout = null; } @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/jqueryui") @Styles.Render("~/Content/bootstrap") @Scripts.Render("~/bundles/bootstrap") @Styles.Render("~/Content/css") @Styles.Render("~/Content/themes/base/css") @Scripts.Render("~/bundles/modernizr") @*@using (Ajax.BeginForm("EditOffice", "Admin", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "edit-Dialog" }))*@ @using (Html.BeginForm("CreateEditOffice", "Admin", "POST")) {
Office @if (ViewBag.IsUpdate == true) { @Html.HiddenFor(model => model.OfficeId) }
@Html.DisplayNameFor(model => model.OfficeName)
@Html.EditorFor(model => model.OfficeName) @Html.ValidationMessageFor(model => Model.OfficeName)
@Html.DisplayNameFor(model => model.SupportNo)
@Html.EditorFor(model => model.SupportNo) @Html.ValidationMessageFor(model => model.SupportNo)
@Html.DisplayNameFor(model => model.SupportEmail)
@Html.EditorFor(model => model.SupportEmail) @Html.ValidationMessageFor(model => model.SupportEmail)
@Html.DisplayNameFor(model => model.SupportFax)
@Html.EditorFor(model => model.SupportFax) @Html.ValidationMessageFor(model => model.SupportFax)
@Html.DisplayNameFor(model => model.SupportFtp)
@Html.EditorFor(model => model.SupportFtp) @Html.ValidationMessageFor(model => model.SupportFtp)

@if (ViewBag.IsUpdate == true) { } else { }
} Then this is the scrip on the parent view: What I'm I doing wrong ????
Side note: You should use .dialog({ autoOpen: false }) instead of .dialog().dialog('close')

以上就是0x800a139e - JavaScript runtime error: cannot call methods on dialog prior to initialization; attempted to call method 'close'的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏