How to stop page load on button click in gridiew with jquery pop up window with mutiple tabbed pane

Last Reply 4 days ago By dharmendr

Posted 12 days ago

Please i want to stop page load on button click in gridiew with jquery pop up window with mutiple tabbed pane

My Code

<%@ Page Language="C#" AutoEventWireup="true"    Debug="true" CodeFile="JobsV1.aspx.cs" Inherits="JobsV1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>VIEW /EDIT JOB</title>


    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
      <script type="text/javascript" src=" https://code.jquery.com/jquery-3.5.1.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>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
    <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script src="ASPSnippets_Pager.min.js" type="text/javascript"></script>

<script type="text/javascript">

    $(function () {
        GetCustomers(1);
        var checked = [];
        $('[id*=chkSelect]').on('click', function () {
            if ($(this).is(":checked")) {
                checked.push($(this).closest('tr').find('td').eq(1).html());
            } else {
                checked.pop($(this).closest('tr').find('td').eq(1).html());
            }

            $('[id*=hfCheckedIds]').val(checked.join(','));
        });
    });

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

    $(document).on('click', '.view', function () {
        $('[id*=hfId]').val($(this).closest('tr').find('td').eq(1).html());
    });
    var i = 0;
    
    var i = 0;
    function GetCustomers(pageIndex) {
        $.ajax({
            type: "POST",
            url: "JobsV1.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>
<style type="text/css">
      .button_color
      {
          background-color:Silver;
      }
  </style>
   <script type="text/javascript">


       function ShowPopup() {
           $('#label41').html('');
           $("#dialog").dialog({
               title: "VIEW  JOB  DETAILS",
               width: 860,
               height: 600,
               buttons: {
                   Close: function () {
                       $(this).dialog('close');
                   }
               },
               modal: true
           });
           $("#dialog").parent().appendTo($("form:first"));

       };


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

               width: 860,
               height: 600,
               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;
           }
       }

      

    </script>

   
  
    <style type="text/css">
        .style6 {
            width: 1079px;
            height: 34px;
        }
 
        html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
        pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q,
        s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul,
        li, fieldset, form, label, legend, caption {
            margin: 0;
            padding: 0;
            border: 0;
            outline: 0;
            font-size: 100%;
            vertical-align: baseline;
            background: transparent;
        }
 
        .style9 {
            width: 104px;
            height: 104px;
        }
 
        .style15 {
            width: 241px;
        }
 
        .style20 {
            width: 687px;
        }
 
        .style23 {
            width: 51px;
        }
 
        .Initial {
        }
 
        .style29 {
            width: 122px;
        }
 
        .style32 {
            width: 148px;
        }
 
        .style33 {
            width: 138px;
        }
 
        .style35 {
            width: 107px;
        }
 
        .style101 {
            border-style: solid;
            border-color: red;
        }
    </style>
    <style type="text/css">
        #customers {
            font-family: Arial, Helvetica, sans-serif;
            border-collapse: collapse;
            width: 100%;
        }
 
            #customers td, #customers th {
                border: 1px solid #ddd;
                padding: 8px;
            }
 
            #customers tr:nth-child(even) {
                background-color:;
            }
 
 
 
            #customers th {
                padding-top: 12px;
                padding-bottom: 12px;
                text-align: left;
                background-color: #4CAF50;
                color: white;
            }
 
        #customers0 {
            font-family: Arial, Helvetica, sans-serif;
            border-collapse: collapse;
            width: 100%;
        }
    </style>
    <style type="text/css">
        #customers1 {
            font-family: Arial, Helvetica, sans-serif;
            border-collapse: collapse;
            width: 100%;
        }
 
            #customers1 td, #customers th {
                border: 1px solid #ddd;
                padding: 8px;
            }
 
            #customers1 tr:nth-child(even) {
                background-color:;
            }
 
 
 
            #customers1 th {
                padding-top: 12px;
                padding-bottom: 12px;
                text-align: left;
                background-color: #4CAF50;
                color: white;
            }
 
        #customers01 {
            font-family: Arial, Helvetica, sans-serif;
            border-collapse: collapse;
            width: 100%;
        }
    </style>

    <style type="text/css">
        #customers12 {
            font-family: Arial, Helvetica, sans-serif;
            border-collapse: collapse;
            width: 100%;
        }
 
            #customers12 td, #customers th {
                border: 1px solid #ddd;
                padding: 8px;
            }
 
            #customers12 tr:nth-child(even) {
                background-color:;
            }
 
 
 
            #customers12 th {
                padding-top: 12px;
                padding-bottom: 12px;
                text-align: left;
                background-color: #4CAF50;
                color: white;
            }
 
       
        }
    </style>
   <style>
table.roundedCorners { 
  border: 1px solid silver;
  border-radius: 6px; 
  border-spacing: 0;
   border-bottom: 1px solid silver;
font-weight:bold;
  }
table.roundedCorners td, 
table.roundedCorners th { 
  border-bottom: 1px solid silver;
  padding: 4px; 
 
  }
  
  
  
  
 table.roundedCorners tr th,
table.roundedCorners tr td {
  border-right: 0.2px solid #bbb;
  
  padding: 5px;
}
table.roundedCorners tr th:first-child,
table.roundedCorners tr td:first-child {
   border-bottom: 1px solid silver;
}
  
  
  
  
  
  
  
  
  
  
table.roundedCorners tr:last-child > td {
  border-bottom: none;
}
 </style>
 <style type="text/css">
    body {
        font-family: Arial;
        font-size: 10pt;
    }
 
    .Pager span {
        text-align: center;
        color: #999;
        display: inline-block;
        width: 20px;
        background-color: #A1DCF2;
        margin-right: 3px;
        line-height: 150%;
        border: 1px solid #3AC0F2;
    }
 
    .Pager a {
        text-align: center;
        display: inline-block;
        width: 20px;
        background-color: #3AC0F2;
        color: #fff;
        border: 1px solid #3AC0F2;
        margin-right: 3px;
        line-height: 150%;
        text-decoration: none;
    }
     .style102
     {
         width: 797px;
     }
 </style>
 
</head>
<table style="width: 100%; height: 10px;" bgcolor="DarkOrange" frame="void">
    <tr>
        <td class="style6">&nbsp;
            <img class="style9" src="Images/capres.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
    </tr>
</table>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <table style="width: 100%;">
            <tr>
                <td class="style15">
                    
                                <table style="width: 50%; height: 47px;">
                                    <tr>
                                        <td class="style24" align="center">
                                            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="Images/l1.jpg"
                                                PostBackUrl="JobsV.aspx" Height="67px" />
                                            <asp:ImageButton ID="ImageButton5" runat="server" ImageUrl="Images/l2.jpg"
                                                PostBackUrl="Jobs.aspx" Height="67px" />
                                        </td>
                                    </tr>
                                </table>
                                <table style="width: 50%; height: 47px;" align="right">
                                    <tr>
                                        <td class="style24" align="right">
                                           <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="Home.aspx">Home</asp:LinkButton> |<asp:LinkButton ID="LinkButton2" runat="server" 
                                onclick="LinkButton2_Click">Logout</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                                <table id="customGrid" class="display" style="width: 100%; height: 164px; color: #000080; background-color: #000099;">
                                    <tr>
                                        <td style="border-style: 1; border-color: #003399; background-color: #FFFFFF" 
                                            class="style102" align="center" bgcolor="White">
                                            <table style="width: 100%; height: 25px;">
                                                <tr>
                                                    <td>
                                                        <strong>VIEW /EDIT JOB</strong></td>
                                                    <td>&nbsp;</td>
                                                    <td align="right">
                                                        <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="Images/del.jpg"
                                                            Width="72px" Height="19px"  OnClientClick="javascript:return Confirmationbox();" />
                                                        <asp:ImageButton ID="ImageButton4" runat="server" ImageUrl="Images/dup.jpg"  
                                                            Width="78px" Height="18px" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style102" align="center" bgcolor="White">
                                            <br />
                                            <br />
                                           
                                                 <asp:HiddenField ID="hfCheckedIds" runat="server" />
                                                <asp:HiddenField ID="hfId" runat="server" />
                                                 
                                                    <asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False"
                                                        BackColor="White" BorderColor="#3366CC" BorderStyle="None"
                                                        Font-Names="Century Gothic" Font-Size="XX-Small" 
                                                        Width="100%" Style="margin-bottom: 0px" CssClass="grid">
                                                        <Columns>
                                                            <asp:TemplateField>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkSelect" runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                           <asp:BoundField DataField="id" HeaderText="S/N" />
                                                            <asp:BoundField DataField="pid" HeaderText="pid" />
                                                            <asp:BoundField DataField="description" HeaderText="Description" />
                                                            <asp:BoundField DataField="country" HeaderText="country" />
                                                            <asp:BoundField DataField="pack" HeaderText="pack" />
                                                            <asp:BoundField DataField="customer" HeaderText="customer" />
                                                            <asp:BoundField DataField="jobnumber" HeaderText="jobnumber" />
                                                            <asp:BoundField DataField="artworkdate" HeaderText="artworkdate" />
                                                            <asp:BoundField DataField="reprodate" HeaderText="reprodate" />
                                                            <asp:BoundField DataField="artworknumber" HeaderText="artworknumber" />
                                                            <asp:BoundField DataField="templateno" HeaderText="templateno" />
                                                             <asp:TemplateField>
                                                                <ItemTemplate>
                                                                    
                                                       <asp:Button  CssClass="view" Text="View" ID="lnkView" runat="server"  OnClick="Inkview_Click"    ForeColor="white"  BackColor="#FF6600"/>
                                                                </ItemTemplate>
                                                                 
                                                            </asp:TemplateField>
                                                             <asp:TemplateField>
                                                                <ItemTemplate>
                                                              <asp:Button  CssClass="view" Text="Edit" ID="lnkView1" runat="server" OnClick="Inkview_Click1"     ForeColor="white"  BackColor="#FF6600"/>
                                                         </ItemTemplate>
                                                            </asp:TemplateField>
                                                
                                                        </Columns>
                                                        <HeaderStyle BackColor="green" Font-Bold="True" ForeColor="#CCCCFF" />
                                                        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                                                        <RowStyle BackColor="White" ForeColor="#003399" />
                                                        <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                                                        <SortedAscendingCellStyle BackColor="#EDF6F6" />
                                                        <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
                                                        <SortedDescendingCellStyle BackColor="#D6DFDF" />
                                                        <SortedDescendingHeaderStyle BackColor="#002876" />
                                                    </asp:GridView>
                                                    <br />
                                              <div class="Pager" style="width: 100%"></div>
                                               
                                            <br />
                                            <br />
                                            <br />
                                            <br />
                                            <br />
                                            <br />
                                            <asp:Label ID="lblRecord" runat="server" Visible="False"></asp:Label>
                                            <asp:Label ID="Label4" runat="server" Visible="False"></asp:Label>
                                            <br />
                                            <asp:Label ID="Label9" runat="server" Visible="False"></asp:Label>
                                            <asp:Label ID="Label47" runat="server" Visible="False"></asp:Label>
                                              <asp:Label ID="Label48" runat="server" Visible="False"></asp:Label>
                                                <asp:Label ID="Label49" runat="server" Visible="False"></asp:Label>
                                            <br />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>








        <div id="dialog" style="display: none;">
            <table align="center"  font-size="10px">
                <tr>
                    <td>
                      <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
                            <ContentTemplate>
           <asp:Button ID="Tab1" runat="server" BorderStyle="None" CssClass="Initial" 
                                OnClick="Tab1_Click" Text="Job.Desc" class="button_color"
                                Font-Bold="True" Width="112px" Font-Names="Arial" Font-Size="Small"  />
                            <asp:Button ID="Tab2" runat="server" BorderStyle="None" CssClass="Initial" 
                                OnClick="Tab2_Click" Text="Material Spec."  Font-Bold="True" Width="112px"
                                Font-Names="Arial"  class="button_color" Font-Size="Small"  />


                         
                                <asp:MultiView ID="MainView" runat="server">
                                    <h3>
                                        <span>Job Description </span>
                                    </h3>
                                    <asp:View ID="View1" runat="server">
                                        <table>
                                            <tr>
                                                <td>
                                                    <strong> Job Specification
                                                     
                                                    </strong>
                                                       
                                                    </p>
                                                    <p>
 
                                                        <p align="center">
                                                            
                                                              
                                                        </p>
                                                        
                                                        <p>
                                                            <asp:Label ID="Label3" runat="server" Font-Size="XX-Small" ForeColor="Red"></asp:Label>
                                                        </p>
                                                        <p align="center">
                                                          
                                                           <asp:Button ID="Button1" runat="server" OnClick="ImageButton30_Click"  Height="80px" Width="294px"
                                                                UseSubmitBehavior="false" style="background:url(./Images/Design.jpg) no-repeat;" />
                                                        </p>
 
                                                        <p>
                                                            
                                                   <table style="width:100%; font-size: x-small; font-family: Candara; font-weight:bolder;" class="roundedCorners" align="center">
                                                       
                                                        <tr >
                                                            <td class="style32">
                                                                <strong>Product Id</strong>
                                                            </td>
                                                            <td class="style29">
                                                                <strong>Description</strong>
                                                            </td>
                                                            <td class="style33">
                                                                <strong>Variant</strong>
                                                            </td>
                                                            <td class="style35">
                                                                <strong>Country</strong>
                                                            </td>
                                                            <td class="style35">
                                                                <strong>Pack</strong>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox7" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox8" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox9" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox10" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox11" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                Customer</td>
                                                            <td class="style29">
                                                                Job Number</td>
                                                            <td class="style33">
                                                                Template Number</td>
                                                            <td class="style35">
                                                                Artwork Date</td>
                                                            <td class="style35">
                                                                Reproduction Date</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox12" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox13" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox14" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox15" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox16" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                Artwork Number</td>
                                                            <td class="style29">
                                                                Printer&#39;s Code</td>
                                                            <td class="style33">
                                                                Reprodction Approved . date</td>
                                                            <td class="style35">
                                                                Artwk Recieved .Date</td>
                                                            <td class="style35">
                                                                Yield</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox17" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox18" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox19" runat="server" Fheight="24px" Font-Size="x-Small" 
                                                                    Height="24px" Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox20" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox21" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                Quantity Around</td>
                                                            <td class="style29">
                                                                Quantity across</td>
                                                            <td class="style33">
                                                                Stretch Double Cut</td>
                                                            <td class="style35">
                                                                Quantity Per Revolution:</td>
                                                            <td class="style35">
                                                                Print Type</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style136" style="font-weight: bold; font-family: 'Century Gothic'">
                                                                <asp:TextBox ID="TextBox22" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style137" style="font-weight: bold; font-family: 'Century Gothic'">
                                                                <asp:TextBox ID="TextBox23" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style138" style="font-weight: bold; font-family: 'Century Gothic'">
                                                                <asp:TextBox ID="TextBox24" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style139" style="font-weight: bold; font-family: 'Century Gothic'">
                                                                <asp:TextBox ID="TextBox25" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                            <td class="style139" style="font-weight: bold; font-family: 'Century Gothic'">
                                                                <asp:TextBox ID="TextBox26" runat="server" Font-Size="x-Small" height="24px" 
                                                                    Width="140px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <caption>
                                                            <p>
                                                                &nbsp;
                                                            </p>
                                                            <p>
                                                                &nbsp;
                                                            </p>
                                                            <p>
                                                                <asp:Label ID="Label2" runat="server" Visible="false"></asp:Label>
                                                                <asp:Label ID="Label33" runat="server" Visible="false"></asp:Label>
                                                                <asp:Label ID="Label001" runat="server" Visible="false"></asp:Label>
                                                                <asp:Label ID="Label1" runat="server" Visible="false"></asp:Label>
                                                                <asp:Label ID="Label8" runat="server" Visible="false"></asp:Label>
                                                                <asp:Label ID="Label15" runat="server" Visible="false"></asp:Label>
                                                                <asp:Label ID="Label16" runat="server" Visible="false"></asp:Label>
                                                            </p>
                                                            <p>
                                                                &nbsp;
                                                            </p>
                                                        </caption>
                                                    </table>
                                    </asp:View>
                                    <asp:View ID="View2" runat="server">
                                        <table style="width: 100%;  border-color: #666;font-family: Candara; font-weight: bold; font-weight: bolder;">
                                        <tr>
                                            <td>
                                                <p style="font-weight: bold">
                                                    Material Specification</p>
                                                <p>
                                                    &nbsp;</p>
                                                
                                                        
                                                        <p align="center">
                                                          
                                                            <asp:Button ID="Button2" runat="server" OnClick="ImageButton30_Click"  Height="80px" Width="294px"
                                                                UseSubmitBehavior="false" style="background:url(./Images/Design.jpg) no-repeat;" />
                                                        </p>
                                                <p>
                                                    &nbsp;</p>
                                                <table border="1" class="roundedCorners" 
                                                    
                                                    style="width:100%; font-size: x-small; font-family: Candara; font-weight: bolder;">
                                                    <tr>
                                                        <td class="style36">
                                                            &nbsp;</td>
                                                        <td class="style32">
                                                            Board Name</td>
                                                        <td class="style29">
                                                            Gsm</td>
                                                        <td class="style33">
                                                            Material Code</td>
                                                        <td class="style35">
                                                            Web Width</td>
                                                        <td class="style35">
                                                            Cost Per Kg</td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style36">
                                                            Board</td>
                                                        <td class="style32">
                                                            <asp:TextBox ID="TextBox27" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style29">
                                                            <asp:TextBox ID="TextBox28" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style33">
                                                            <asp:TextBox ID="TextBox29" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style35">
                                                            <asp:TextBox ID="TextBox30" runat="server" Width="125px"  height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style35">
                                                            <asp:TextBox ID="TextBox31" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style36" style="font-weight: bold; font-family: Candara ;">
                                                            Foil</td>
                                                        <td class="style32" style="font-weight: bold; font-family: Candara ;">
                                                            <asp:TextBox ID="TextBox32" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style29" style="font-weight: bold; font-family: Candara ;">
                                                            <asp:TextBox ID="TextBox33" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style33" style="font-weight: bold; font-family: Candara ;">
                                                            <asp:TextBox ID="TextBox34" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style35" style="font-weight: bold; font-family: Candara ;">
                                                            <asp:TextBox ID="TextBox35" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>
                                                        <td class="style35" style="font-weight: bold; font-family: Candara ;">
                                                            <asp:TextBox ID="TextBox36" runat="server" Width="125px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                        </td>


                                                    </tr>
                                                </table>

                                                <br /><br /><br /><br />
                                                
                                            </td>
                                        </tr>
                                    </table>
                                    </asp:View>
                                
 
                                </asp:MultiView>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="Tab1" EventName="click" />
                                <asp:AsyncPostBackTrigger ControlID="Tab2" EventName="click" />
                               
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </table>
        </div>




                                  



 <div id="dialog1" style="display: none;">
            <table align="center"  font-size="xx-small">
                <tr>
                    <td>
                       <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
                            <ContentTemplate>
                                <asp:Button ID="Tab9" runat="server" BorderStyle="None" CssClass="Initial" 
                                OnClick="Tab9_Click" Text="Job.Desc" class="button_color"
                                Font-Bold="True" Width="112px" Font-Names="Arial" Font-Size="Small"   />

                                <asp:Button ID="Tab10" runat="server" BorderStyle="None" CssClass="Initial" 
                                OnClick="Tab10_Click" Text="Material.Spec" class="button_color"
                                Font-Bold="True" Width="112px" Font-Names="Arial" Font-Size="Small"  />

                                
                                <asp:MultiView ID="MainView2" runat="server">
                                    <h3>
                                        <span>Job Description </span>
                                    </h3>
                                    <asp:View ID="View21" runat="server">
                                        <table>
                                            <tr>
                                                <td>
                                                    <strong> Job Specification
                                                     
                                                    </strong>
                                                       
                                                    
                                                    <p   align="center">  <asp:Label ID="Label40" runat="server" Width="400px" ForeColor="White" BackColor="#339966" Visible="False"></asp:Label></p>
 
                                                        <p align="center">
                                                            <%--<asp:ImageButton ID="ImageButton1" runat="server" Height="34px"
                                                                ImageUrl="~/Images/submit.jpg" OnClick="ImageButton30_Click" Width="142px" />--%>
                                                            <asp:Button ID="ImageButton16" runat="server" OnClick="ImageButton16_Click" Height="27px" Width="90px"
                                                                UseSubmitBehavior="false" style="background:url(./Images/Uexport.jpg) no-repeat;" />
                                                        </p>
 
                                                        <p>
                                                            <asp:Label ID="Label10" runat="server" Font-Size="XX-Small" ForeColor="Red"></asp:Label>
                                                        </p>
 
                                                        <p>
                                                            <table style="width: 80%; font-size: x-small; font-family: 'Arial Narrow'; font-weight: bold;" border="1"
                                                                class="roundedCorners" align="center">
 
                                                                <tr>
                                                            <td class="style32" 
                                                                >
                                                                Product Id</td>
                                                            <td class="style29">
                                                                Description</td>
                                                            <td class="style33">
                                                                Variant</td>
                                                            <td class="style35">
                                                                Country</td>
                                                            <td class="style35">
                                                                Pack</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox581" runat="server" Width="140px"    height="24px"   Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox582" runat="server" Width="140px"  height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox583" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox></td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox584" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox585" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                Customer</td>
                                                            <td class="style29">
                                                                Job Number</td>
                                                            <td class="style33">
                                                                Template Number</td>
                                                            <td class="style35">
                                                                Artwork Date</td>
                                                            <td class="style35">
                                                                Reproduction Date</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox586" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox587" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox588" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox589" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox590" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                Artwork Number</td>
                                                            <td class="style29">
                                                                Printer&#39;s Code</td>
                                                            <td class="style33">
                                                                Repro. Approved date</td>
                                                            <td class="style35">
                                                                Artwk Recieved .Date</td>
                                                            <td class="style35">
                                                                Yield</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox591" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox592" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox593" runat="server" Width="140px" Fheight="24px"  
                                                                    Font-Size="x-Small" Height="24px"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox594" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox5941" runat="server" Width="140px"  height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style32">
                                                                Quantity Around</td>
                                                            <td class="style29">
                                                                Quantity across</td>
                                                            <td class="style33">
                                                                Stretch Double Cut</td>
                                                            <td class="style35">
                                                                Quantity Per Rev.</td>
                                                            <td class="style35">
                                                                Print Type</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style136">
                                                                <asp:TextBox ID="TextBox595" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style137">
                                                                <asp:TextBox ID="TextBox596" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style138">
                                                                <asp:TextBox ID="TextBox597" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style139">
                                                                <asp:TextBox ID="TextBox598" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style139">
                                                                <asp:TextBox ID="TextBox599" runat="server" Width="140px" height="24px"  Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                    </table>
                                        </p>
                                                        <p>
                                                            &nbsp;
                                                        </p>
                                        <p>
                                            &nbsp;

                                        </p>
                                        <p>
                                            <asp:Label ID="Label11"  runat="server" Visible="false"></asp:Label>
                                            <asp:Label ID="Label12"  runat="server" Visible="false" ></asp:Label>
                                            <asp:Label ID="Label13" runat="server" Visible="false"></asp:Label>
                                        </p>
                                        <p>
                                            &nbsp;
                                        </p>
                                        </td>
                </tr>
            </table>
                                    </asp:View>





                                    <asp:View ID="View22" runat="server">
                                        <table>
                                            <tr>
                                                <td>
                                                     <strong> Material Specification  </strong>
                                                     
                                                    
                                                       
                                                        
                                                   
                                                    <p>
                                                        &nbsp;
                                                    </p>
                                                    <p   align="center">  <asp:Label ID="Label41" runat="server" Width="400px" ForeColor="White" BackColor="#339966" Visible="False"></asp:Label></p>
 
                                                    <p align="center">
                                                     <asp:Button ID="ImageButton17" runat="server" OnClick="ImageButton17_Click" Height="27px" Width="90px"
                                                                UseSubmitBehavior="false" style="background:url(./Images/Uexport.jpg) no-repeat;" />  </p>
                                                    <br />
                                                    <table style="width: 80%; font-size: x-small; font-family: 'Arial Narrow'; font-weight: bold;" border="1"
                                                        class="roundedCorners" align="center">
                                                        <tr>
                                                            <td class="style36">&nbsp;</td>
                                                            <td class="style32">Board Name</td>
                                                            <td class="style29">Gsm</td>
                                                            <td class="style33">Material Code</td>
                                                            <td class="style35">Web Width</td>
                                                            <td class="style35">Cost Per Kg</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style36">Board</td>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox600" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox601" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox602" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox603" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox604" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="style36">Foil</td>
                                                            <td class="style32">
                                                                <asp:TextBox ID="TextBox605" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style29">
                                                                <asp:TextBox ID="TextBox606" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style33">
                                                                <asp:TextBox ID="TextBox607" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox608" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                            <td class="style35">
                                                                <asp:TextBox ID="TextBox609" runat="server" Width="140px" Height="24px" Font-Size="x-Small"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <br />
                                                    <br />
                                                    <br />
                                                    <br />
                                                    <br />
                                                    <br />
                                                  
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:View>





 
                                </asp:MultiView>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="Tab9" EventName="click" />
                                <asp:AsyncPostBackTrigger ControlID="Tab10" EventName="click" />
                                
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </table>
        </div>

       

    </form>

    <script type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        if (prm != null) {
            prm.add_endRequest(function (sender, e) {
                if (sender._postBackSettings.panelsToUpdate != null) {
                    GetCustomers(1);
                }
            });
        };
       
</script>
</body>
</html>

/////////////////////////////////////////////////////////////////////



    string selectSQL, updateSQL, selectSQL1;
    private static int PageSize = 15;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            BindDummyRow();
        }


        MainView.ActiveViewIndex = 0;
        MainView2.ActiveViewIndex = 0;

    }


    private void BindDummyRow()
    {
        DataTable dummy = new DataTable();
        dummy.Columns.Add("id");
        dummy.Columns.Add("pid");
        dummy.Columns.Add("description");
        dummy.Columns.Add("Country");
        dummy.Columns.Add("pack");
        dummy.Columns.Add("customer");
        dummy.Columns.Add("jobnumber");
        dummy.Columns.Add("artworkdate");
        dummy.Columns.Add("reprodate");
        dummy.Columns.Add("artworknumber");
        dummy.Columns.Add("templateno");


        dummy.Rows.Add();
        gvDetails.DataSource = dummy;
        gvDetails.DataBind();
        //gvDetails.UseAccessibleHeader = true;
        //gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
    }




    [WebMethod]
    public static string GetCustomers(int pageIndex)
    {
        string query = "[boj]";
        SqlCommand cmd = new SqlCommand(query);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@PageIndex", pageIndex);
        cmd.Parameters.AddWithValue("@PageSize", PageSize);
        cmd.Parameters.Add("@RecordCount", SqlDbType.Int, 4).Direction = ParameterDirection.Output;

        return GetData(cmd, pageIndex).GetXml();
    }

    private static DataSet GetData(SqlCommand cmd, int pageIndex)
    {
        string strConnString = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
        using (SqlConnection con = new SqlConnection(strConnString))
        {
            using (SqlDataAdapter sda = new SqlDataAdapter())
            {
                cmd.Connection = con;
                sda.SelectCommand = cmd;
                using (DataSet ds = new DataSet())
                {
                    sda.Fill(ds, "job");
                    DataTable dt = new DataTable("Pager");
                    dt.Columns.Add("PageIndex");
                    dt.Columns.Add("PageSize");
                    dt.Columns.Add("RecordCount");
                    dt.Rows.Add();
                    dt.Rows[0]["PageIndex"] = pageIndex;
                    dt.Rows[0]["PageSize"] = PageSize;
                    dt.Rows[0]["RecordCount"] = cmd.Parameters["@RecordCount"].Value;
                    ds.Tables.Add(dt);
                    return ds;
                }
            }
        }
    }
    protected void Tab1_Click(object sender, EventArgs e)
    {

        Tab1.CssClass = "Clicked";
        Tab2.CssClass = "Initial";
        

        Tab1.Style.Add("background-color", "orange");
        Tab2.Style.Add("background-color", "Silver");
       
        MainView.ActiveViewIndex = 0;
        gvDetails.UseAccessibleHeader = true;
        gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
        ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup()", true);

        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", Session["DatakeyValue"]);
        Label1.Text = Convert.ToString(cm.ExecuteScalar());
        con.Close();

        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();
        }


    }
    protected void Tab2_Click(object sender, EventArgs e)
    {


        Tab1.CssClass = "Initial";
        Tab2.CssClass = "Clicked";
        

        Tab2.Style.Add("background-color", "orange");
        Tab1.Style.Add("background-color", "Silver");
       
        MainView.ActiveViewIndex = 1;
        gvDetails.UseAccessibleHeader = true;
        gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
        ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup()", true);
        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", Session["DatakeyValue"]);
        Label1.Text = Convert.ToString(cm.ExecuteScalar());
        con.Close();

        string selectSQL12;
        selectSQL12 = "SELECT TOP 1 * From (select Top 2 * from job_material  where pid='" + Label1.Text + "' ORDER BY id DESC) x ORDER BY id   ";
        dbConn12.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";
        cmd12.Connection = dbConn12;
        cmd12.CommandText = selectSQL12;
        cmd12.CommandType = CommandType.Text;

        try
        {
            dbConn12.Open();
            dr12 = cmd12.ExecuteReader();
            if (dr12.Read())
            {
                TextBox27.Text = dr12["boardname"].ToString();
                TextBox28.Text = dr12["materialgsm"].ToString();
                TextBox29.Text = dr12["materialcode"].ToString();
                TextBox30.Text = dr12["materialwebwidth"].ToString();

                TextBox31.Text = dr12["costpersqmeter"].ToString();
            }

            dr12.Close();
        }

        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn12.Close();
        }



        string selectSQL13;
        selectSQL13 = " SELECT Top 1 * FROM job_material   where pid ='" + Label1.Text + "' order by id desc ";
        dbConn13.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";
        cmd13.Connection = dbConn13;
        cmd13.CommandText = selectSQL13;
        cmd13.CommandType = CommandType.Text;

        try
        {
            dbConn13.Open();
            dr13 = cmd13.ExecuteReader();
            if (dr13.Read())
            {
                TextBox32.Text = dr13["boardname"].ToString();
                TextBox33.Text = dr13["materialgsm"].ToString();
                TextBox34.Text = dr13["materialcode"].ToString();
                TextBox35.Text = dr13["materialwebwidth"].ToString();

                TextBox36.Text = dr13["costpersqmeter"].ToString();
            }

            dr13.Close();
        }

        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn13.Close();
        }
    }








    protected void Tab9_Click(object sender, EventArgs e)
    {
        Label40.Visible = false;

        Tab9.CssClass = "Clicked";
        Tab10.CssClass = "Initial";
       
        Tab9.Style.Add("background-color", "orange");
        Tab10.Style.Add("background-color", "Silver");
        
        MainView2.ActiveViewIndex = 0;
        gvDetails.UseAccessibleHeader = true;
        gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
        ScriptManager.RegisterStartupScript((sender as Control), this.GetType(), "Popup", "ShowPopup1();", 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())
            {
                TextBox581.Text = dr1["pid"].ToString();
                TextBox582.Text = dr1["description"].ToString();
                TextBox583.Text = dr1["variant"].ToString();
                TextBox584.Text = dr1["country"].ToString();
                TextBox585.Text = dr1["pack"].ToString();
                TextBox586.Text = dr1["customer"].ToString();
                TextBox587.Text = dr1["jobnumber"].ToString();
                TextBox588.Text = dr1["templateno"].ToString();
                TextBox589.Text = dr1["artworkdate"].ToString();
                TextBox590.Text = dr1["reprodate"].ToString();
                TextBox591.Text = dr1["artworknumber"].ToString();
                TextBox592.Text = dr1["nampak"].ToString();
                TextBox593.Text = dr1["reproapproveddate"].ToString();
                TextBox594.Text = dr1["artworkreceiveddate"].ToString();
                TextBox5941.Text = dr1["yields"].ToString();
                TextBox595.Text = dr1["qtyaround"].ToString();
                TextBox596.Text = dr1["qtyacross"].ToString();
                TextBox597.Text = dr1["stretchdoublecut"].ToString();
                TextBox598.Text = dr1["qtyperrevolution"].ToString();
                TextBox599.Text = dr1["printtype"].ToString();
            }
            dr1.Close();
        }
        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn1.Close();
        }



    }
    protected void Tab10_Click(object sender, EventArgs e)
    {
        Label41.Visible = false;

        Tab9.CssClass = "Clicked";
        Tab10.CssClass = "Initial";
       
        Tab10.Style.Add("background-color", "orange");
        Tab9.Style.Add("background-color", "Silver");
      
        MainView2.ActiveViewIndex = 1;
        gvDetails.UseAccessibleHeader = true;
        gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
        ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup1()", true);
        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", Session["DatakeyValue"]);
        Label1.Text = Convert.ToString(cm.ExecuteScalar());
        con.Close();

        string selectSQL12;
        selectSQL12 = "SELECT TOP 1 * From (select Top 2 * from job_material  where pid='" + Label1.Text + "'  ORDER BY id DESC) x ORDER BY id   ";
        dbConn12.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";
        cmd12.Connection = dbConn12;
        cmd12.CommandText = selectSQL12;
        cmd12.CommandType = CommandType.Text;

        try
        {
            dbConn12.Open();
            dr12 = cmd12.ExecuteReader();
            if (dr12.Read())
            {
                TextBox600.Text = dr12["boardname"].ToString();
                TextBox601.Text = dr12["materialgsm"].ToString();
                TextBox602.Text = dr12["materialcode"].ToString();
                TextBox603.Text = dr12["materialwebwidth"].ToString();
                TextBox604.Text = dr12["costpersqmeter"].ToString();
            }

            dr12.Close();
        }

        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn12.Close();
        }



        string selectSQL13;
        selectSQL13 = " SELECT Top 1 * FROM job_material   where pid ='" + Label1.Text + "' order by id desc ";
        dbConn13.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";
        cmd13.Connection = dbConn13;
        cmd13.CommandText = selectSQL13;
        cmd13.CommandType = CommandType.Text;

        try
        {
            dbConn13.Open();
            dr13 = cmd13.ExecuteReader();
            if (dr13.Read())
            {
                TextBox605.Text = dr13["boardname"].ToString();
                TextBox606.Text = dr13["materialgsm"].ToString();
                TextBox607.Text = dr13["materialcode"].ToString();
                TextBox608.Text = dr13["materialwebwidth"].ToString();
                TextBox609.Text = dr13["costpersqmeter"].ToString();
            }

            dr13.Close();
        }

        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn13.Close();
        }
    }
   
    protected void Inkview_Click(object sender, EventArgs e)
    {
        int id = 0;
        int.TryParse(hfId.Value, out id);
        Session["DatakeyValue"] = id;

        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 pid FROM job WHERE id=@id ";
        cm.Parameters.AddWithValue("@id", Session["DatakeyValue"]);
        Label1.Text = Convert.ToString(cm.ExecuteScalar());
        con.Close();



        //

        MainView.ActiveViewIndex = 0;
        Tab1.CssClass = "Clicked";
        Tab2.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 pid ='" + 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();
        }

        // gvDetails.DataBind();
    }

    protected void Inkview_Click1(object sender, EventArgs e)
    {

        int id = 0;
        int.TryParse(hfId.Value, out id);
        Session["DatakeyValue"] = id;
        // Session["DatakeyValue"] = Label2.Text;


        // Session["DatakeyValue"] = id;
        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", Session["DatakeyValue"]);
        Label1.Text = Convert.ToString(cm.ExecuteScalar());
        con.Close();

        MainView.ActiveViewIndex = 0;
        Tab9.CssClass = "Clicked";
        Tab10.CssClass = "Initial";
        

        gvDetails.UseAccessibleHeader = true;
        gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
        ScriptManager.RegisterStartupScript((sender as Control), this.GetType(), "Popup", "ShowPopup1();", true);

        selectSQL = " SELECT * FROM job where id ='" + Label1.Text + "' ";
        dbConn1.ConnectionString = "data source=NERO-SIGBENU\\SQLEXPRESS01; Initial Catalog=arpackaging;Integrated Security=True;";
        cmd1.Connection = dbConn1;
        cmd1.CommandText = selectSQL;
        cmd1.CommandType = CommandType.Text;
        try
        {
            dbConn1.Open();
            dr1 = cmd1.ExecuteReader();
            if (dr1.Read())
            {
                TextBox581.Text = dr1["pid"].ToString();
                TextBox582.Text = dr1["description"].ToString();
                TextBox583.Text = dr1["variant"].ToString();
                TextBox584.Text = dr1["country"].ToString();
                TextBox585.Text = dr1["pack"].ToString();
                TextBox586.Text = dr1["customer"].ToString();
                TextBox587.Text = dr1["jobnumber"].ToString();
                TextBox588.Text = dr1["templateno"].ToString();
                TextBox589.Text = dr1["artworkdate"].ToString();
                TextBox590.Text = dr1["reprodate"].ToString();
                TextBox591.Text = dr1["artworknumber"].ToString();
                TextBox592.Text = dr1["nampak"].ToString();
                TextBox593.Text = dr1["reproapproveddate"].ToString();
                TextBox594.Text = dr1["artworkreceiveddate"].ToString();
                TextBox5941.Text = dr1["yields"].ToString();
                TextBox595.Text = dr1["qtyaround"].ToString();
                TextBox596.Text = dr1["qtyacross"].ToString();
                TextBox597.Text = dr1["stretchdoublecut"].ToString();
                TextBox598.Text = dr1["qtyperrevolution"].ToString();
                TextBox599.Text = dr1["printtype"].ToString();
            }
            dr1.Close();
        }
        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn1.Close();
        }





    }

    
    protected void ImageButton16_Click(object sender, EventArgs e)
    {
        updateSQL = "UPDATE job  set ";

        updateSQL += "pid=@pid,description=@description,variant=@variant,country=@country,pack=@pack,customer=@customer,jobnumber=@jobnumber,templateno=@templateno,";
        updateSQL += "artworkdate=@artworkdate,reprodate=@reprodate,artworknumber=@artworknumber,nampak=@nampak,reproapproveddate=@reproapproveddate,";
        updateSQL += "artworkreceiveddate=@artworkreceiveddate,yields=@yields,qtyaround=@qtyaround,qtyacross=@qtyacross,stretchdoublecut=@stretchdoublecut ,qtyperrevolution=@qtyperrevolution,printtype=@printtype     WHERE id ='" + Label1.Text + "' ";




        dbConn2.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";


        cmd1.Connection = dbConn2;
        cmd1.CommandText = updateSQL;
        cmd1.CommandType = CommandType.Text;




        cmd1.Parameters.AddWithValue("@Pid", TextBox581.Text);
        cmd1.Parameters.AddWithValue("@description", TextBox582.Text);
        cmd1.Parameters.AddWithValue("@variant", TextBox583.Text);
        cmd1.Parameters.AddWithValue("@country", TextBox584.Text);
        cmd1.Parameters.AddWithValue("@pack", TextBox585.Text);

        cmd1.Parameters.AddWithValue("@customer", TextBox586.Text);
        cmd1.Parameters.AddWithValue("@jobnumber", TextBox587.Text);
        cmd1.Parameters.AddWithValue("@templateno", TextBox599.Text);
        cmd1.Parameters.AddWithValue("@artworkdate", TextBox588.Text);
        cmd1.Parameters.AddWithValue("@reprodate", TextBox589.Text);
        cmd1.Parameters.AddWithValue("@artworknumber", TextBox590.Text);

        cmd1.Parameters.AddWithValue("@nampak", TextBox591.Text);
        cmd1.Parameters.AddWithValue("@reproapproveddate", TextBox592.Text);
        cmd1.Parameters.AddWithValue("@artworkreceiveddate", TextBox593.Text);
        cmd1.Parameters.AddWithValue("@yields", TextBox594.Text);
        cmd1.Parameters.AddWithValue("@qtyaround", TextBox595.Text);
        cmd1.Parameters.AddWithValue("@qtyacross", TextBox596.Text);
        cmd1.Parameters.AddWithValue("@stretchdoublecut", TextBox597.Text);
        cmd1.Parameters.AddWithValue("@qtyperrevolution", TextBox598.Text);
        cmd1.Parameters.AddWithValue("@printtype", TextBox599.Text);





        try
        {
            dbConn2.Open();
            int updated = cmd1.ExecuteNonQuery();
            Label40.Visible = true;
            Label40.Text = " records updated.";
            MainView.ActiveViewIndex = 0;
            Tab9.CssClass = "Clicked";
            Tab10.CssClass = "Initial";
          


            MainView2.ActiveViewIndex = 1;
            BindDummyRow();

            // Or Set UseAccessibleHeader and HeaderRow TableSection
            gvDetails.UseAccessibleHeader = true;
            gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;


        }


        catch (Exception err)
        {
            Response.Redirect(err.Message);
        }
        finally
        {
            dbConn2.Close();
        }
    }
    protected void ImageButton17_Click(object sender, EventArgs e)
    {

        updateSQL = "UPDATE job_material  set ";




        updateSQL += "boardname=@boardname,materialgsm=@materialgsm,materialcode=@materialcode,materialwebwidth=@materialwebwidth,costpersqmeter=@costpersqmeter  where id  = (SELECT TOP 1 * From (select Top 2  id  from job_material  where pid='" + Label1.Text + "' ORDER BY id DESC) x ORDER BY id )";











        dbConn2.ConnectionString ="Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";


        cmd1.Connection = dbConn2;
        cmd1.CommandText = updateSQL;
        cmd1.CommandType = CommandType.Text;


        cmd1.Parameters.AddWithValue("@boardname", TextBox600.Text);
        cmd1.Parameters.AddWithValue("@materialgsm", TextBox601.Text);
        cmd1.Parameters.AddWithValue("@materialcode", TextBox602.Text);
        cmd1.Parameters.AddWithValue("@materialwebwidth", TextBox603.Text);
        cmd1.Parameters.AddWithValue("@costpersqmeter", TextBox604.Text);
        cmd1.Parameters.AddWithValue("@pid", Label1.Text);



        try
        {

            dbConn2.Open();
            int updated = cmd1.ExecuteNonQuery();


            // dbConn2.Close();

            // Call the BindUserDetails to refresh the data.

            // gvDetails.UseAccessibleHeader = true;
            // gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;


            // Or Set UseAccessibleHeader and HeaderRow TableSection


        }


        catch (Exception err)
        {
            Response.Redirect(err.Message);
        }
        finally
        {
            dbConn2.Close();
        }



        string updateSQL1;
        updateSQL1 = "UPDATE job_material  set ";



        updateSQL1 += "boardname=@boardname,materialgsm=@materialgsm,materialcode=@materialcode,materialwebwidth=@materialwebwidth,costpersqmeter=@costpersqmeter   where id  = (select top 1 id  from  job_material where pid='" + Label1.Text + "' order by id desc)  ";





        dbConn3.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog=kaging;Integrated Security=True;";


        cmd2.Connection = dbConn3;
        cmd2.CommandText = updateSQL1;
        cmd2.CommandType = CommandType.Text;


        cmd2.Parameters.AddWithValue("@boardname", TextBox605.Text);
        cmd2.Parameters.AddWithValue("@materialgsm", TextBox606.Text);
        cmd2.Parameters.AddWithValue("@materialcode", TextBox607.Text);
        cmd2.Parameters.AddWithValue("@materialwebwidth", TextBox608.Text);
        cmd2.Parameters.AddWithValue("@costpersqmeter", TextBox609.Text);
        cmd2.Parameters.AddWithValue("@pid", Label1.Text);



        try
        {

            dbConn3.Open();
            int updated1 = cmd2.ExecuteNonQuery();
            if (updated1 == 1)
            {



            }
            else
            {


                Label1.Text = "Process not Completed";
            }

            Label41.Visible = true;
            Label41.Text = " records updated.";
            Tab9.CssClass = "Initial";
            Tab10.CssClass = "Clicked";
         
            MainView2.ActiveViewIndex = 1;
            gvDetails.UseAccessibleHeader = true;
            gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
            BindDummyRow();


        }


        catch (Exception err)
        {
            Response.Redirect(err.Message);
        }
        finally
        {
            dbConn3.Close();
        }

    }
  
    protected void ImageButton30_Click(object sender, EventArgs e)
    {
        Response.Redirect("Choose.aspx");
    }
   


    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Home.aspx");
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        DateTime date1 = Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy hh:mm tt"));


        updateSQL = "update usertracking set loggedout='" + date1 + "' where username='" + Session["username"].ToString() + "' and loggedin='" + Session["date"].ToString() + "' ";

        dbConn.ConnectionString = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog= kaging;Integrated Security=True";
        cmd.Connection = dbConn;
        cmd.CommandText = updateSQL;
        cmd.CommandType = CommandType.Text;
        try
        {

            dbConn.Open();
            //  Response.Write(updateSQL);

            int updated = cmd.ExecuteNonQuery();
            if (updated == 1)
            {
                Response.Redirect("Welcome.aspx");
            }
            else
            {


                //Label1.Text = "Process not Completed";
            }

            dbConn.Close();
        }
        catch (Exception err)
        {
            Response.Write(err.ToString());
        }
        finally
        {
            dbConn.Close();
        }

    }

}







please help

You are viewing reply posted by: dharmendr 4 days ago.
Posted 4 days ago

You need refer below link and write code to make ajax call to the web method.

Stop page load (refresh) on Button Click inside jQuery Modal Popup in ASP.Net

First write code and let us know if any issue.