• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 153
  • Last Modified:

jquery: Object doesn't support property or method 'dialog' jquery.1.12.4.js, asp.net

Hi, Please let me know how to fix this issue.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="default" MasterPageFile="~/Masterpage.Master"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp"%>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
  <iframe id="frameName1" src="index.aspx" frameborder="0" scrolling="auto" width="30%" height="1000px" align="left"></iframe>
     <iframe id="frameName2" src="home.htm" frameborder="0" scrolling="auto" width="70%" height="1000px" align="right"></iframe>
     
 
         <script src="scripts/jquery-1.12.4.js" type="text/javascript"></script>
    <script type="text/javascript">
var sessionTimeout = "<%= Session.Timeout %>";
function DisplaySessionTimeout(timeout) {
    var seconds = timeout / 1000;
    document.getElementsByName("seconds").innerHTML = seconds;
    setInterval(function () {
        seconds--;
        document.getElementById("seconds").innerHTML = seconds;
    }, 1000);
    setTimeout(function () {
        //Show Popup before 20 seconds of timeout.
        $("#ExpireConfirm_Submit").dialog({
            height: 200,
            width: 400,
            resizable: false,               
            modal: true,               
            title: "Session Expire Confirmation",                             
            open: function () {
                $('p#id1').html(sessionTimeout);
            },
            buttons: {
                "Yes": function () {                       
                    $(location).attr("href", "SessionExpired.aspx").submit();
                    $(this).dialog("close");
                },
                "No": function () {                       
                    ResetSession();
                    $(this).dialog("close");
                }
            }
        }).prev(".ui-dialog-titlebar").css("background", "red");
    }, timeout - 55 * 1000);
    setTimeout(function () {
        $(location).attr("href", "SessionExpired.aspx").submit();
    }, timeout);
};
function ResetSession() {
    window.location = window.location.href;
}   
</script>
 
     <div id="ExpireConfirm_Submit">
<table>
    <tr>
        <td style="width: 230px;">
            Your Session will expire in <span id="seconds"></span>&nbsp;seconds.<br />
            Please submit/update your changes or you will loose your data.
        </td>
    </tr>
</table></div>
    </asp:Content>

Open in new window

0
Saroj13
Asked:
Saroj13
  • 2
2 Solutions
 
zephyr_hex (Megan)DeveloperCommented:
jQuery dialog requires jQuery UI.

<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

Open in new window

You'll also want the CSS
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

Open in new window


More:
https://jqueryui.com/dialog/
0
 
Jim RiddlesPrepress/OMS SpecialistCommented:
You need to include a reference to jQueryUI to use modal dialogs.  You would include it after line 11 in your code.

Here's a link to a page that has links to all jQueryUI version:
https://code.jquery.com/ui/
0
 
Jim RiddlesPrepress/OMS SpecialistCommented:
The solutions provided answer the author's question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now