Crystal report toolbar appended if jQuery Datatable plugin Applied in ASP.Net

Last Reply on Apr 24, 2017 07:11 AM By YacharuP

Posted on Apr 24, 2017 03:11 AM

Hi Guys,

I implemented jquery datatable plugin to gridview and in same page crystal report viewer also present.

When i view crystal report the crystal report toolbar is appearing in gridview showing an error message in console like below

Uncaught TypeError: Cannot read property 'mData' of undefined at HTMLTableCellElement.<anonymous> (jquery.dataTables.min.js:316) at Function.each (jquery-2.2.3.min.js:2) at n.fn.init.each (jquery-2.2.3.min.js:2) at HTMLTableElement.<anonymous> (jquery.dataTables.min.js:315) at Function.each (jquery-2.2.3.min.js:2) at n.fn.init.each (jquery-2.2.3.min.js:2) at n.fn.init.m [as dataTable] (jquery.dataTables.min.js:303) at n.fn.init.S.h.fn.DataTable (jquery.dataTables.min.js:574) at HTMLDocument.<anonymous> (Customer_Registration.aspx:388) at j (jquery-1.11.1.min.js:2)

Below is my complete code

 

<%@ Page Title="Customer Registration" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Customer_Registration.aspx.cs" Inherits="Customer_Registration" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="pj" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <style type="text/css">
        body {
            font-family: Arial;
            font-size: 10pt;
        }

        .ErrorControl {
            background-color: #FBE3E4;
            border: solid 1px Red;
        }

        .auto-style6 {
            color: #FFFFFF;
        }
    </style>
    <script type="text/javascript">
        function WebForm_OnSubmit() {
            if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
                for (var i in Page_Validators) {
                    try {
                        var control = document.getElementById(Page_Validators[i].controltovalidate);
                        if (!Page_Validators[i].isvalid) {
                            control.className = "form-control ErrorControl";
                        } else {
                            control.className = "form-control";
                        }
                    } catch (e) { }
                }
                return false;
            }
            return true;
        }
    </script>
    <script type="text/javascript">
        function PrintPanel() {
            var panel = document.getElementById("<%=dvContents.ClientID %>");
            var printWindow = window.open('', '', 'height=600,width=1200');
            printWindow.document.write('<html><head><title>Customer QR Code</title>');
            printWindow.document.write('</head><body >');
            printWindow.document.write(panel.innerHTML);
            printWindow.document.write('</body></html>');
            printWindow.document.close();
            setTimeout(function () {
                printWindow.print();
            }, 500);
            return false;
        }
    </script>
    <script type="text/javascript">
        function Print() {
            var dvReport = document.getElementById("dvReport");
            var frame1 = dvReport.getElementsByTagName("iframe")[0];
            if (navigator.appName.indexOf("Internet Explorer") != -1) {
                frame1.name = frame1.id;
                window.frame[frame1.id].focus();
                window.frame[frame1.id].print();
            }
            else {
                var frameDoc = frame1.contentWindow ? frame1.contentWindow : frame1.contentDocument.document ? frame1.contentDocument.document : frame1.contentDocument;
                frameDoc.print();
                window.location('Customer_Registration.aspx');
            }
        }
    </script>
    <asp:ScriptManager ID="ScriptManager2" runat="server"></asp:ScriptManager>
    <script type="text/javascript">
        $(function () {
            $('[id$=grd_customer_master]').prepend($("<thead></thead>").append($(this).find("tr:first"))).DataTable({
                "responsive": true,
                "sPaginationType": "full_numbers",
                "aoColumnDefs": [{ 'bSortable': false, 'aTargets': [0] }]
            });
            $('[id$=grd_customer_master] tr:first').eq(0).find('th').eq(0).removeClass();
        });
    </script>

    <!-- Area & Route Modal start -->
    <div class="modal fade modal-default" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModal3Label">Add an area & allocate it to a route</h4>
                </div>
                <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div class="modal-body">
                            <div class="form-group">
                                <label>New Area Name</label>
                                <asp:TextBox ID="txt_new_area" runat="server" CssClass="form-control" placeholder="Name of the new area" Style="text-transform: uppercase"></asp:TextBox>
                            </div>
                            <div class="form-group">
                                <label>Allocate the entered area to one of the routes</label>
                                <asp:DropDownList ID="drp_route" AutoPostBack="true" OnSelectedIndexChanged="drp_route_SelectedIndexChanged" runat="server" CssClass="form-control">
                                    <asp:ListItem>--SELECT--</asp:ListItem>
                                </asp:DropDownList>
                            </div>
                            <div class="form-group" id="newroutediv" runat="server" visible="false">
                                <label>Enter new route name</label>
                                <asp:TextBox ID="txt_new_route" runat="server" CssClass="form-control" placeholder="Name of the new route" Style="text-transform: uppercase"></asp:TextBox>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <div class="modal-footer">
                    <asp:Button ID="btn_close" runat="server" CausesValidation="false" class="btn btn-default" Text="Close" data-dismiss="modal" />
                    <asp:Button ID="btn_save" CausesValidation="false" runat="server" class="btn btn-primary" Text="Allocate & Save" OnClick="btn_submit_Click1" />
                    <label id="lblmsg" runat="server"></label>
                </div>
            </div>
        </div>
    </div>
    <%-- Area & Route Modal end --%>

    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>Customers</h1>
        <ol class="breadcrumb">
            <li><a href="DashBoard.aspx"><i class="fa fa-dashboard"></i>Home</a></li>
            <li class="active">Customers</li>
        </ol>
    </section>

    <link rel="stylesheet" href="images/ProgressBar.css" />
    <%-- <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div class="modal11">
                <div class="center">
                    <img alt="" src="images/svghourglass.svg" />
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>--%>
    <section class="content">
        <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>--%>
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">Customer Registration</h3>
                <asp:Label ID="lblID" runat="server" Text="New" Visible="False"></asp:Label>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                </div>
            </div>
            <div class="box-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>First name<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_firstname" runat="server" placeholder="Enter First Name" TabIndex="1" Style="text-transform: uppercase" CssClass="form-control" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="req_vldtr_fname" runat="server" ErrorMessage="Firstname required"
                                ControlToValidate="txt_firstname" SetFocusOnError="true" CssClass="pull-right"
                                ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Last name<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_LastName" runat="server" placeholder="Enter the Last Name" TabIndex="2" Style="text-transform: uppercase" CssClass="form-control" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="req_vldtr_lname" runat="server" ErrorMessage="Lastname required"
                                ControlToValidate="txt_LastName" SetFocusOnError="true" CssClass="pull-right"
                                ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Mobile<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_Mobile" runat="server" placeholder="Enter your Mobile Number" onkeypress="return isNumberKey(event)" TabIndex="3" MaxLength="10" CssClass="form-control"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="req_vldtr_mobile" runat="server" ErrorMessage="Mobile number required"
                                ControlToValidate="txt_Mobile" SetFocusOnError="true" CssClass="pull-right"
                                ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Invalid mobile number entered"
                                ControlToValidate="txt_Mobile" SetFocusOnError="true" CssClass="pull-right" ForeColor="Red" Font-Bold="true"
                                ValidationExpression="[789][0-9]{9}"></asp:RegularExpressionValidator>
                            <%--(?:\s+|)((0|(?:(\+|)91))(?:\s|-)*(?:(?:\d(?:\s|-)*\d{9})|(?:\d{2}(?:\s|-)*\d{8})|(?:\d{3}(?:\s|-)*\d{7}))|\d{10})(?:\s+|)--%>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Pincode<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_Pincode" runat="server" placeholder="Pin Code" TabIndex="4" onkeypress="return isNumberKey(event)" CssClass="form-control" MaxLength="6"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="req_vldtr_pincode" runat="server"
                                ErrorMessage="Enter pin-code" ControlToValidate="txt_pincode" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Enter Valid Pincode" ControlToValidate="txt_Pincode" SetFocusOnError="True" ValidationExpression="[5][0-9]{5}" CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Email<i class="auto-style6" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_email" TabIndex="5" placeholder="abc123@example.com" CssClass="form-control"
                                runat="server" MaxLength="50"></asp:TextBox>
                            <%--<asp:RequiredFieldValidator ID="req_vldtr_email" runat="server" ErrorMessage="Email required"
                                        ControlToValidate="txt_email" SetFocusOnError="true" CssClass="pull-right"
                                        ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="exp_vldtr_email" runat="server" ErrorMessage="Invalid email entered| Check your caps Lock!"
                                        ControlToValidate="txt_email" SetFocusOnError="true" CssClass="pull-right" ForeColor="Red"
                                        Font-Bold="true" ValidationExpression="\w+([-+.]\w+)*@(yahoo\.com|gmail\.com|outlook\.com|yahoo\.co.in|rediffmail\.com)"></asp:RegularExpressionValidator>--%>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Phone<i class="auto-style6" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_Phone" runat="server" placeholder="Enter your Phone Number(Optional)" TabIndex="6" CssClass="form-control" MaxLength="15"></asp:TextBox>
                            <pj:FilteredTextBoxExtender ID="txt_phone_FilteredTextBoxExtender" runat="server" BehaviorID="txt_phone_FilteredTextBoxExtender" InvalidChars="&amp;^%$#@!()+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" TargetControlID="txt_phone" ValidChars="1234567890-" />
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txt_phone" ValidationExpression="\d{3,5}([-]*)\d{5,10}" ErrorMessage="Invalid Phone Number" CssClass="pull-right" Font-Bold="True" ForeColor="Red"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>District<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_District" runat="server" CssClass="form-control">
                                <asp:ListItem>--SELECT--</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="req_vldtr_district" runat="server"
                                ErrorMessage="District cannot be left unselected" ControlToValidate="ddl_district" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Taluk<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_Taluka" runat="server" CssClass="form-control">
                                <asp:ListItem>--SELECT--</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="req_vldtr_taluka" runat="server"
                                ErrorMessage="Taluk cannot be left unselected" ControlToValidate="ddl_taluka" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Area<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_Area" runat="server" AutoPostBack="false" TabIndex="7" CssClass="form-control">
                                <asp:ListItem>--SELECT--</asp:ListItem>
                            </asp:DropDownList>
                            <a href="#myModal3" data-toggle="modal" class="small-box-footer">The area is not listed/I want to add a new one <i class="fa fa-arrow-circle-right"></i></a>
                            <asp:RequiredFieldValidator ID="req_vldtr_area" runat="server"
                                ErrorMessage="Area cannot be left unselected" ControlToValidate="ddl_Area" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Company<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_Company" runat="server" TabIndex="8" CssClass="form-control">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                ErrorMessage="Company cannot be left unselected" ControlToValidate="ddl_Company" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Scheme Type<i class="text-red" style="font-size: large"></i></label>
                            <asp:DropDownList ID="ddl_scheme_type" runat="server" TabIndex="9" CssClass="form-control">
                            </asp:DropDownList>
                            <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                ErrorMessage="Scheme cannot be left unselected" ControlToValidate="ddl_scheme_type" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>--%>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Customer Type<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_customer_type" runat="server" TabIndex="10" CssClass="form-control" OnSelectedIndexChanged="ddl_customer_type_SelectedIndexChanged">
                                <asp:ListItem Text="--SELECT--" Value="0" />
                                <asp:ListItem Text="REGULAR" Value="1" />
                                <asp:ListItem Text="FUNCTIONAL" Value="2" />
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                                ErrorMessage="Customer cannot be left unselected" ControlToValidate="ddl_customer_type" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>No. Of Cans<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_cans" runat="server" onkeypress="return this.value.length<=1" TabIndex="11" CssClass="form-control" MaxLength="2" placeholder="No. Of Cans"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
                                ErrorMessage="Cans Required" ControlToValidate="txt_cans" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>No. Of Jars<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_dispensaries" runat="server" onkeypress="return this.value.length<=1" TabIndex="12" CssClass="form-control" MaxLength="2" placeholder="No. Of Jars"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                                ErrorMessage="Jars Required" ControlToValidate="txt_dispensaries" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Frequency<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_frequency" runat="server" onkeypress="return this.value.length<=2" TabIndex="13" CssClass="form-control" MaxLength="3" placeholder="Frequency"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
                                ErrorMessage="Frequency cannot be left" ControlToValidate="txt_frequency" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Rate Per can<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_rate_per_can" runat="server" onkeypress="return isNumberKey(event)" placeholder="Rate Per can" TabIndex="14" CssClass="form-control" MaxLength="7"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                ErrorMessage="Rate cannot be left blank" ControlToValidate="txt_rate_per_can" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="txt_rate_per_can" CssClass="pull-right" ForeColor="Red" Font-Bold="true" MinimumValue="0" MaximumValue="500000" ErrorMessage="Invalid Amount"></asp:RangeValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Payment Mode<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_payment" runat="server" TabIndex="15" CssClass="form-control" OnSelectedIndexChanged="ddl_payment_SelectedIndexChanged" AutoPostBack="true">
                                <asp:ListItem>--SELECT--</asp:ListItem>
                                <asp:ListItem>Cash</asp:ListItem>
                                <asp:ListItem>Cheque</asp:ListItem>
                                <asp:ListItem>DD</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                ErrorMessage="Payment Mode cannot be left unselected" ControlToValidate="ddl_payment" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Deposit<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_Deposit" runat="server" placeholder="Deposit Amount(in Rupees)" TabIndex="16" onkeypress="return isNumberKey(event)" CssClass="form-control" MaxLength="8" Enabled="false"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                                ErrorMessage="Deposit cannot be left unselected" ControlToValidate="txt_Deposit" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txt_deposit" CssClass="pull-right" ForeColor="Red" Font-Bold="true" MinimumValue="0" MaximumValue="500000" ErrorMessage="Invalid Amount"></asp:RangeValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Cheque/DD Number<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_cheque_dd" runat="server" CssClass="form-control" MaxLength="17" placeholder="Cheque/DD Number" Enabled="false"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server"
                                ErrorMessage="Cheque/DD Number Required" ControlToValidate="txt_cheque_dd" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Cheque/DD Date<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_date" runat="server" CssClass="form-control" MaxLength="18" placeholder="Cheque/DD Date" Enabled="false"></asp:TextBox>
                            <pj:CalendarExtender ID="txt_date_CalendarExtender" runat="server" BehaviorID="txt_date_CalendarExtender" Format="dd/MM/yyyy" TargetControlID="txt_date" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
                                ErrorMessage="Cheque/DD Date Required" ControlToValidate="txt_date" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Bank Name<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_bank" runat="server" CssClass="form-control" placeholder="Bank Name" Enabled="false" Style="text-transform: uppercase"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
                                ErrorMessage="Bank Name Required" ControlToValidate="txt_bank" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Account Opening Date<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_o_date" runat="server" TabIndex="17" CssClass="form-control" MaxLength="18" placeholder="Account Opening Date"></asp:TextBox>
                            <pj:CalendarExtender ID="CalendarExtender1" runat="server" BehaviorID="txt_o_date_CalendarExtender" TargetControlID="txt_o_date" Format="dd/MM/yyyy"/>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Address<i class="text-red" style="font-size: large">*</i></label>
                            <asp:TextBox ID="txt_Address" OnTextChanged="txt_Address_TextChanged" runat="server" placeholder="Residential or work address that can be used for communication." TabIndex="18" TextMode="MultiLine" CssClass="form-control" MaxLength="60" Style="resize: none;text-transform: uppercase" AutoPostBack="true"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="req_vldtr_address" runat="server"
                                ErrorMessage="Enter home or work address" ControlToValidate="txt_address" SetFocusOnError="true"
                                CssClass="pull-right" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Billing Type<i class="text-red" style="font-size: large">*</i></label>
                            <asp:DropDownList ID="ddl_bill_type" runat="server" TabIndex="15" CssClass="form-control" OnSelectedIndexChanged="ddl_payment_SelectedIndexChanged" AutoPostBack="true">
                                <asp:ListItem>--SELECT--</asp:ListItem>
                                <asp:ListItem>Cash & Carry</asp:ListItem>
                                <asp:ListItem>Monthly Billing</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server"
                                ErrorMessage="Billing Type Required" ControlToValidate="ddl_bill_type" SetFocusOnError="true"
                                CssClass="pull-right" InitialValue="--SELECT--" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <b>Continue with the Alternate Contact Details section below.</b>&nbsp;<i class="fa fa-arrow-down"></i>
            </div>
            <div class="box-header with-border">
                <h3 class="box-title">Alternate Contact Details</h3>
            </div>
            <div class="box-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Contact person name</label>
                            <asp:TextBox ID="txt_Contactpersonname" Style="text-transform: uppercase" runat="server" placeholder="Alternate Contact Person Name" TabIndex="19" onkeypress="return onlyAlphabets(event, this);" CssClass="form-control" Rows="30"></asp:TextBox>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Mobile Number</label>
                            <asp:TextBox ID="txt_Contactpersonmobile" runat="server" placeholder="Alternate Contact Person Mobile Number" TabIndex="22" onkeypress="return isNumberKey(event)" MaxLength="20" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>

                </div>
                <asp:Panel runat="server" class="row" ID="dvContents">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label id="qrnamelabel" runat="server">Name: </label>
                            <label id="qrname" class="form-control" runat="server"></label>
                            <label id="qraddresslabel" runat="server">Address: </label>
                            <label id="qraddress" class="form-control info-box" runat="server"></label>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <br />
                            <center><asp:Image ID="Image1" runat="server" Height="100px" Width="100px" /></center>
                            <center><label>Savidhare Minerals</label></center>
                        </div>
                    </div>
                </asp:Panel>
            </div>
            <div class="box-footer">
                <div style="float: right">
                    <input type="checkbox" id="msgtoggle" runat="server" tabindex="19" checked="checked" data-toggle="toggle" data-on="<i class='fa fa-paper-plane-o'/> Send" data-onstyle="success" data-off="<i class='fa fa-ban'/> Don't send" data-offstyle="danger" /> &nbsp;
                    <asp:Button ID="btn_submit" TabIndex="20" CssClass="form-control btn btn-primary"
                        runat="server" Text="Submit" OnClick="btn_submit_Click" Width="100px" />
                    &nbsp;&nbsp;                         
                            <asp:Button ID="btn_reset" ValidationGroup="-" TabIndex="21" CssClass="form-control btn btn-danger"
                                runat="server" Text="Reset" Width="100px" OnClick="btn_reset_Click1" />&nbsp;&nbsp;
                    
                </div>
                <input type="button" tabindex="18" onclick="PrintPanel();" value="Print QR Code" class="btn btn-danger" />
                <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" ValidationGroup="000" Visible="false"/>
            </div>
        </div>
        <%--</ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ddl_customer_type" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="ddl_District" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="ddl_Taluka" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="ddl_scheme_type" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="ddl_Company" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="txt_Address" EventName="TextChanged" />
                <asp:AsyncPostBackTrigger ControlID="btn_submit" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btn_reset" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>--%>
        <div class="box box-success" id="report" runat="server">
            <div class="box-header with-border">
                <h3 class="box-title">Report</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
                <div class="row">
                    <div class="col-md-12">
                        <div id="dvReport" style="overflow: scroll;">
                            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" HasCrystalLogo="False" HasDrilldownTabs="False" HasDrillUpButton="False" HasExportButton="False" HasPrintButton="False" HasToggleGroupTreeButton="False" HasToggleParameterPanelButton="False" ToolPanelView="None" SeparatePages="True" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <div class="pull-right">
                        <asp:Button ID="btn_print" runat="server" Text="Print" CssClass="form-control btn btn-success" Width="100px" OnClientClick="Print()" ValidationGroup="*"/>
                </div>
            </div>
        </div>
        <%--<asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>--%>
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">Registered Customers</h3>
            </div>
            <div class="box-footer"></div>
            <div class="row">
                <div class="col-xs-12">
                    <div class="box-body">
                        <asp:GridView ID="grd_customer_master" AlternatingRowStyle-Wrap="true" GridLines="None" runat="server" DataKeyNames="customer_id" AutoGenerateColumns="False" Width="100%" OnRowCommand="grd_customer_master_RowCommand" CssClass="table table-striped table-hover table-responsive">
                            <AlternatingRowStyle Wrap="True"></AlternatingRowStyle>
                            <Columns>
                                <asp:TemplateField HeaderText="Actions" ShowHeader="False" ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Edt" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"><i class="fa fa-edit"></i></asp:LinkButton>
                                        <asp:LinkButton ID="Button1" runat="server" CausesValidation="false" CommandName="Dlt" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" OnClientClick="return confirm('Are You Sure Want To Delete Record?')"><i class="fa fa-trash"></i></asp:LinkButton>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="prnt" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"><i class="fa fa-print"></i></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="fname" HeaderText="First Name">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="lname" HeaderText="Last Name">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="mobile_no" HeaderText="Mobile No">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="address" HeaderText="Address">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="pincode" HeaderText="Pincode">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="frequency" HeaderText="Frequency">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="dispensaries" HeaderText="Dispensaries">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="deposit" HeaderText="Deposit">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="contact_person" HeaderText="Contact Person">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="alt_mobile_no" HeaderText="Alternative Mob">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="rate_per_can" HeaderText="Rate Per Can">
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                </asp:BoundField>
                                <%--<asp:BoundField DataField="email" HeaderText="E-Mail" >
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="phone" HeaderText="Phone" >
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                    </asp:BoundField>--%>
                            </Columns>
                        </asp:GridView>
                    </div>
                </div>
            </div>
        </div>
        <%--</ContentTemplate>
        </asp:UpdatePanel>--%>
    </section>
</asp:Content>

 

Posted on Apr 24, 2017 07:11 AM

Finally i found the problem and solved it by replacing code

i changed 

.append($(this)) to .append($('[id$=grd_customer_master]'))

and it worked fine for me.