Jquery modal pop up fails to popup

Last Reply 14 days ago By lingers

Posted 19 days ago

On page load i see this error on the console

Default22.aspx:79 Uncaught TypeError: $(...).ASPSnippets_Pager is not a function at Object.success (Default22.aspx:79) at fire (jquery-3.5.1.js:3496) at Object.fireWith [as resolveWith] (jquery-3.5.1.js:3626) at done (jquery-3.5.1.js:9786) at XMLHttpRequest.<anonymous> (jquery-3.5.1.js:10047)

 

<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css" />
<script type="text/javascript" src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
<script src="JS/ASPSnippets_Pager.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        GetCustomers(1);
    });

    $(".Pager .page").live("click", function () {
        GetCustomers(parseInt($(this).attr('page')));
    });

    var i = 0;
    function GetCustomers(pageIndex) {
        $.ajax({
            type: "POST",
            url: "Default22.aspx/GetCustomers",
            data: '{pageIndex: ' + pageIndex + '}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                $('[id$=gvDetails]').prepend($("<thead></thead>").append($('[id$=gvDetails]').find("tr:first"))).DataTable().destroy();
                var xmlDoc = $.parseXML(response.d);
                var xml = $(xmlDoc);
                var customers = xml.find("job");
                var row = $("[id$=gvDetails] tbody tr:last-child").eq(0).clone(true);
                $("[id$=gvDetails] tbody tr").not($("[id$=gvDetails] tbody tr:first-child")).remove();
                $.each(customers, function () {
                    $("td", row).eq(1).html($(this).find("id").text());
                    $("td", row).eq(2).html($(this).find("pid").text());
                    $("td", row).eq(3).html($(this).find("description").text());
                    $("td", row).eq(4).html($(this).find("country").text());
                    $("td", row).eq(5).html($(this).find("pack").text());
                    $("td", row).eq(6).html($(this).find("customer").text());
                    $("td", row).eq(7).html($(this).find("jobnumber").text());
                    $("td", row).eq(8).html($(this).find("artworkdate").text());
                    $("td", row).eq(9).html($(this).find("reprodate").text());
                    $("td", row).eq(10).html($(this).find("artworknumber").text());
                    $("td", row).eq(11).html($(this).find("templateno").text());
                    $("[id$=gvDetails]").append(row);
                    row = $("[id$=gvDetails] tbody tr:last-child").eq(0).clone(true);
                });
                $("[id$=gvDetails] tbody tr:first-child").remove();
                if (i != 0) {
                    $('[id$=gvDetails]').DataTable({
                        "paging": false,
                        "info": false
                    });
                } else {
                    $('[id$=gvDetails]')
                        .prepend($("<thead></thead>").append($('[id$=gvDetails]').find("tr:first")))
                        .DataTable({
                            "paging": false,
                            "info": false
                        });
                }
                i++;
                var pager = xml.find("Pager");
                $(".Pager").ASPSnippets_Pager({
                    ActiveCssClass: "current",
                    PagerCssClass: "pager",
                    PageIndex: parseInt(pager.find("PageIndex").text()),
                    PageSize: parseInt(pager.find("PageSize").text()),
                    RecordCount: parseInt(pager.find("RecordCount").text())
                });
            },
            failure: function (response) {
                alert(response.responseText);
            },
            error: function (response) {
                alert(response.responseText);
            }
        });
    }
</script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<link href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
<script type="text/javascript" src=" https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
    function ShowPopup() {
        $('#label41').html('');
        $("#dialog").dialog({
            title: "VIEW  JOB  DETAILS",
            width: 830,
            height: 500,
            buttons: {
                Close: function () {
                    $(this).dialog('close');
                }
            },
            modal: true
        });
        $("#dialog").parent().appendTo($("form:first"));
    };

    function ShowPopup1() {
        $('#label71').html('');
        $("#dialog1").dialog({
            title: "EDIT  JOB  DETAILS",

            width: 830,
            height: 500,
            buttons: {
                Close: function () {
                    $(this).dialog('close');
                }
            },
            modal: true
        });

        $("#dialog1").parent().appendTo($("form:first"));
    };

    function Confirmationbox() {
        var result = confirm('Are you sure you want to delete selected User(s)?');
        if (result) {
            return true;
        } else {
            return false;
        }
    }
    $('#example').dataTable({
        "ajax": "sources/arrays.txt",
        "deferRender": true
    });
</script>

 

protected void Inkview_Click(object sender, EventArgs e)
{
    int rowIndex = ((sender as Button).NamingContainer as GridViewRow).RowIndex;
    int lbl1 = Convert.ToInt32(gvDetails.DataKeys[rowIndex].Values[0]);
    Session["DatakeyValue"] = lbl1;
    SqlConnection con = new SqlConnection("data source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;");
    SqlCommand cm = new SqlCommand();
    cm.Connection = con;
    con.Open();
    cm.CommandType = CommandType.Text;
    cm.CommandText = "SELECT id FROM job WHERE id=@id";
    cm.Parameters.AddWithValue("@id", Convert.ToInt32(Session["DatakeyValue"]));
    Label1.Text = Convert.ToString(cm.ExecuteScalar());
    con.Close();
    MainView.ActiveViewIndex = 0;
    Tab9.CssClass = "Clicked";
    Tab10.CssClass = "Initial";
    Tab11.CssClass = "Initial";
    Tab12.CssClass = "Initial";
    Tab13.CssClass = "Initial";
    Tab14.CssClass = "Initial";
    Tab15.CssClass = "Initial";
    gvDetails.UseAccessibleHeader = true;
    gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
    ScriptManager.RegisterStartupScript((sender as Control), this.GetType(), "Popup", "ShowPopup();", true);
    selectSQL = " SELECT * FROM job where id ='" + Label1.Text + "' ";
    dbConn1.ConnectionString = "data source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";
    cmd1.Connection = dbConn1;
    cmd1.CommandText = selectSQL;
    cmd1.CommandType = CommandType.Text;
    try
    {
        dbConn1.Open();
        dr1 = cmd1.ExecuteReader();
        if (dr1.Read())
        {
            TextBox7.Text = dr1["pid"].ToString();
            TextBox8.Text = dr1["description"].ToString();
            TextBox9.Text = dr1["variant"].ToString();
            TextBox10.Text = dr1["country"].ToString();
            TextBox11.Text = dr1["pack"].ToString();
            TextBox12.Text = dr1["customer"].ToString();
            TextBox13.Text = dr1["jobnumber"].ToString();
            TextBox14.Text = dr1["templateno"].ToString();
            TextBox15.Text = dr1["artworkdate"].ToString();
            TextBox16.Text = dr1["reprodate"].ToString();
            TextBox17.Text = dr1["artworknumber"].ToString();
            TextBox18.Text = dr1["nampak"].ToString();
            TextBox19.Text = dr1["reproapproveddate"].ToString();
            TextBox20.Text = dr1["artworkreceiveddate"].ToString();
            TextBox21.Text = dr1["yields"].ToString();
            TextBox22.Text = dr1["qtyaround"].ToString();
            TextBox23.Text = dr1["qtyacross"].ToString();
            TextBox24.Text = dr1["stretchdoublecut"].ToString();
            TextBox25.Text = dr1["qtyperrevolution"].ToString();
            TextBox26.Text = dr1["printtype"].ToString();
        }
        dr1.Close();
    }
    catch (Exception err)
    {
        Response.Write(err.ToString());
    }
    finally
    {
        dbConn1.Close();
    }
}

 

You are viewing reply posted by: lingers 14 days ago.