Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > ช่วยทีค่าาา ต้องการ code ที่ทำให้ GridView สามารถแสดงได้ในทุกๆ Tab Contrainer ค่ะ



 

ช่วยทีค่าาา ต้องการ code ที่ทำให้ GridView สามารถแสดงได้ในทุกๆ Tab Contrainer ค่ะ

 



Topic : 082468



โพสกระทู้ ( 8 )
บทความ ( 0 )



สถานะออฟไลน์




ต้องการให้ GridView แสดงในทุกๆ Tabs ค่ะ

ปัญหาคือ GridView จะแสดงเฉพาะ Tab 1 ส่วน Tab ที่เหลือไม่โชว์

GridView ที่ว่า ผู้ใช้สามารถกรอกข้อมูลลงไปในตารางได้ด้วย ซื้อข้อมูลของ GridView ในแต่ละ Tab ก็จะแตกต่างกันไปด้วย

ก็เลยใช้ Tab1 ใช้ Gridview id :"Gridview1" ส่วนTab 2 ก็ใช้ Gridview id : "Gridview2"

แต่ผลปรากฎว่ามันโชว์เฉพาะ Gridview1 ใน Tab1 เท่านั้น ส่วน Tab2 ไม่แสดง Gridview2 :(
tab1
Tab1 แสดง Gridview1

tab2


.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SerialItemReqForm.aspx.cs" Inherits="SerialItemReqForm" Title="Serial Item Request Form" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        #TextArea1
        {
            height: 50px;
            width: 161px;
        }
        #RSI_Remark
        {
            width: 150px;
            height: 45px;
        }
        .style20
        {
            height: 37px;
        }
        .style28
        {
            width: 154px;
            text-align: right;
            height: 90px;
        }
        .style30
        {
            height: 90px;
        }
    .style31
    {
        height: 90px;
        width: 312px;
    }
    .style33
    {
        width: 312px;
        height: 37px;
    }
        .style34
        {
            width: 312px;
            text-align: left;
        }
        .style35
        {
            width: 154px;
            text-align: right;
            height: 43px;
        }
        .style36
        {
            height: 43px;
        }
        .style37
        {
            width: 312px;
            height: 43px;
        }
        .style53
        {
            text-align: right;
            height: 24px;
            }
        .style62
        {
            height: 90px;
            width: 4px;
        }
        .style64
        {
            height: 43px;
            width: 4px;
        }
        .style65
        {
            height: 37px;
            width: 4px;
        }
        .style67
        {
            width: 4px;
        }
        .style68
        {
            text-align: right;
        }
        .style69
        {
            width: 154px;
            text-align: right;
            height: 77px;
        }
        .style70
        {
            width: 4px;
            height: 77px;
        }
        .style71
        {
            width: 312px;
            height: 77px;
        }
        .style72
        {
            height: 77px;
        }
        .style75
        {
            width: 312px;
            text-align: left;
            height: 43px;
        }
        .style79
        {
            width: 154px;
            text-align: right;
            height: 80px;
        }
        .style80
        {
            width: 4px;
            height: 80px;
        }
        .style81
        {
            width: 312px;
            height: 80px;
        }
        .style82
        {
            height: 80px;
        }
        .style83
        {
            width: 154px;
            text-align: right;
            height: 30px;
        }
        .style84
        {
            width: 4px;
            height: 30px;
        }
        .style85
        {
            width: 312px;
            text-align: left;
            height: 30px;
        }
        .style86
        {
            height: 30px;
        }
        
          html
        {
            background-color:silver;
        }
        .tabs
        {
            position:relative;
            top:1px;
            left:10px;
            margin-top: 1px;
        }
        .tab
        {
            border:solid 1px black;
            background-color:#eeeeee;
            padding:2px 10px;
        }
        .selectedTab
        {
            background-color:white;
            border-bottom:solid 1px white;
        }
        .tabContents
        {
            border:solid 1px black;
            padding:10px;
            background-color:white;
        }
        
        .ajax__tab_header
        {
            text-align: right;
        }
        .style90
        {
            text-align: left;
            height: 124px;
        }
        
        
        .style91
        {
            text-align: right;
            height: 41px;
        }
        .style92
        {
            width: 4px;
            height: 41px;
        }
        .style93
        {
            width: 312px;
            text-align: left;
            height: 41px;
        }
        .style94
        {
            height: 41px;
        }
        
        
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    Request for generating serial items (แบบร้องขอ serial items)
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <table style="width:100%; height: auto;">
        <tr>
            <td class="style68">
 
                <asp:Label ID="Label31" runat="server" Text="ส่วนที่1:" 
                    style="font-weight: 700; font-size: small; color: #6699FF"></asp:Label>

                <br />
                <asp:Label ID="Label36" runat="server" style="font-weight: 700; color: #3399FF" 
                    Text="ข้อมูลทั่วไป"></asp:Label>

            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style83">
 
                <asp:Label ID="Label53" runat="server" Text="รหัสแบบคำร้อง:"></asp:Label>

                <br />
                <asp:Label ID="Label54" runat="server" Text="Request Form ID:"></asp:Label>

            </td>
            <td class="style84">
                </td>
            <td class="style85">
                <asp:Label ID="lblRSI_ID" runat="server" Text="Label"></asp:Label>
            </td>
            <td class="style86">
                </td>
        </tr>
        <tr>
            <td class="style69">
 
                <asp:Label ID="Label1" runat="server" Text="วันที่ยื่นคำร้อง:"></asp:Label>
                <br />
                <asp:Label ID="Label2" runat="server" Text="Request Date:"></asp:Label>

                <br />
                <asp:Label ID="Label51" runat="server" Text="( ปี/เดือน/วัน)"></asp:Label>

            </td>
            <td class="style70">
                </td>
            <td class="style71">
                
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>
                <asp:Timer ID="TimerTime" runat="server" Interval="1000"></asp:Timer>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:TextBox ID="txtRSI_ReqDate" runat="server" BackColor="Transparent" 
                        ReadOnly="True" Width="100px" >
                    </asp:TextBox>
                    <asp:Label ID="Label37" runat="server" Text="เวลา (Time):"></asp:Label>
                    <asp:TextBox ID="txtRSI_ReqTime" runat="server" Width="100px" BackColor="Transparent" ReadOnly="True"></asp:TextBox>
                </ContentTemplate>  
                <Triggers>  
                    <asp:AsyncPostBackTrigger ControlID="TimerTime" EventName="Tick" />  
                </Triggers>  
                </asp:UpdatePanel>  

             <br />

            </td>
            <td class="style72">
                </td>
        </tr>
        <tr>
            <td class="style28">
                <asp:Label ID="Label3" runat="server" Text="วันที่ต้องการรับงาน:"></asp:Label><br />
                <asp:Label ID="Label4" runat="server" Text="Deadline:"></asp:Label>
                <br />
                <asp:Label ID="Label52" runat="server" Text="( ปี/เดือน/วัน)"></asp:Label>
                <br />
                
                </td>
            <td class="style62">
                </td>
            <td class="style31">
                        
               
                        <asp:TextBox ID="txtRSI_DeadlineDate" runat="server" Width="100px"  ></asp:TextBox>
                        <asp:CalendarExtender ID="CalendarExtender1" runat="server" 
                    TargetControlID="txtRSI_DeadlineDate" Format="yyyy/MM/dd" >
                        </asp:CalendarExtender>
                        <asp:Label ID="Label38" runat="server" Text="เวลา (Time): "></asp:Label>
                        <asp:TextBox ID="txtRSI_DeadlineTime" runat="server" Width="100px"></asp:TextBox>
 
                        <br />
 <div style="height: 37px; width: 271px"><asp:comparevalidator ID="Comparevalidator1" runat="server" 
                            errormessage="*วันที่ต้องการรับงานต้องมากกว่าวันที่ยื่นแบบคำร้อง (The deadline must be greater than request date)" Type="Date" 
                            ControlToCompare="txtRSI_ReqDate" Display="Dynamic" 
                            ControlToValidate="txtRSI_DeadlineDate" Operator="GreaterThan" /></div>
                        
                   <asp:RadioButtonList ID="DeadlineType" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Text ="ปกติ (Normal)" Value="N" Selected="True"></asp:ListItem>
                        <asp:ListItem Text = "งานด่วน (Urgent)" Value="Y"></asp:ListItem>
                    </asp:RadioButtonList>
           
                        
            </td>
            <td class="style30">
                </td>
        </tr>
        <tr>
            <td class="style79" valign="top">
                <asp:Label ID="Label5" runat="server" Text="ชื่อแผนงาน/กิจกรรม:"></asp:Label><br />
                 <asp:Label ID="Label6" runat="server" Text="Project/Event Name:"></asp:Label>
                 
            </td>
            <td class="style80">
                </td>
            <td class="style81">
                <asp:TextBox ID="txtRSI_ProjectName" runat="server" Width="220px" 
                    TextMode="MultiLine" Height="50px" ></asp:TextBox>
               <div style="width: 210px; height: 33px;"> 
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtRSI_ProjectName" 
                    ErrorMessage="*กรุณากรอกชื่อแผนงาน/กิจกรรม        (Project/Event Name Is Required!)" 
                    SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator></div>
                <br />
            </td>
            <td class="style82">
                </td>
        </tr>
        <tr>
            <td class="style35" valign="top">
                <asp:Label ID="Label7" runat="server" Text="เป้าหมายการตลาด:"></asp:Label><br />
                 <asp:Label ID="Label8" runat="server" Text="Target Marketing:"></asp:Label>
            </td>
            <td class="style64">
                </td>
            <td class="style37">
                <asp:TextBox ID="txtRSI_TargetMarket" runat="server" Width="220px" 
                    TextMode="MultiLine" Height="50px"></asp:TextBox>
                <div style="height: 37px; width: 177px"><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="*กรุณากรอกเป้าหมายการตลาด (Target Marketing Is Required!)" 
                        ControlToValidate="txtRSI_TargetMarket" SetFocusOnError="True" 
                        Display="Dynamic"></asp:RequiredFieldValidator></div>
            </td>
            <td class="style36">
            </td>
        </tr>
        <tr>
            <td class="style35" valign="top">
                <asp:Label ID="Label11" runat="server" Text="ชื่อเกม:"></asp:Label>
                <br />
                <asp:Label ID="Label12" runat="server" Text="Game Name:"></asp:Label>
            </td>
            <td class="style64">
                </td>
            <td class="style75">
                <asp:DropDownList ID="ddlGameName" runat="server" Width="150px" Height="22px">
                    <asp:ListItem></asp:ListItem>
                </asp:DropDownList>
                <%--  </asp:View>
                                    <asp:View ID="Tab2" runat="server">
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                    </asp:View>
                                    <asp:View ID="Tab3" runat="server">
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                    </asp:View>
                                </asp:MultiView>
                            </div>--%>
            </td>
            <td class="style36">
                </td>
                
        </tr>
        <tr>
            <td class="style68" valign="top">
                <asp:Label ID="Label13" runat="server" Text="จุดประสงค์:"></asp:Label>
                <br />
                <asp:Label ID="Label14" runat="server" Text="Objectives:"></asp:Label>
            </td>
            <td class="style65">
                &nbsp;</td>
            <td class="style33">
                <asp:DropDownList ID="ddlObjective" runat="server" Width="150px" Height="22px">
                </asp:DropDownList>
               <div style="width: 329px"> <%-- <asp:Menu ID="Menu1" Runat="server" CssClass="tabs" 
                                OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal" 
                                StaticMenuItemStyle-CssClass="tab" StaticSelectedStyle-CssClass="selectedTab">
                                <Items>
                                    <asp:MenuItem Selected="true" Text="Tab 1" Value="0" />
                                    <asp:MenuItem Text="Tab 2" Value="1" />
                                    <asp:MenuItem Text="Tab 3" Value="2" />
                                </Items>
                            </asp:Menu>
                            <div class="tabContents">
                                <asp:MultiView ID="MultiView1" Runat="server" ActiveViewIndex="0">
                                    <asp:View ID="Tab1" runat="server">
                                        <br />--%></div> 
            </td>
            <td class="style20">
                </td>
        </tr>
        <tr>
            <td class="style68" valign="top">
                <asp:Label ID="Label9" runat="server" Text="จำนวนผลิต:"></asp:Label><br />
                <asp:Label ID="Label10" runat="server" Text="Production Amount:"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34">
                <asp:TextBox ID="txtRSI_NumOfProd" runat="server" Width="100px"></asp:TextBox>
               
            <%--  </asp:View>
                                    <asp:View ID="Tab2" runat="server">
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                    </asp:View>
                                    <asp:View ID="Tab3" runat="server">
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                    </asp:View>
                                </asp:MultiView>
                            </div>--%>
               
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style68">
                            <asp:Label ID="Label33" runat="server" style="font-weight: 700; color: #6699FF" 
                                Text="ส่วนที่2: "></asp:Label>
                                        <br />
                            <asp:Label ID="Label34" runat="server" style="font-weight: 700; color: #3399FF" 
                                Text="การอนุมัติงาน"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                            &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style68" valign="top">
                            <asp:Label ID="Label39" runat="server" Text="หัวหน้างาน/หัวหน้าฝ่าย" 
                                            style="text-align: right"></asp:Label>
                                        <br />
                            <asp:Label ID="Label44" runat="server" Text="Project/Dept. Leader"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                            <asp:DropDownList ID="ddlDeptLeader" runat="server" Width="160px">
                            </asp:DropDownList>
                                                <br />
                            <%-- <asp:Menu ID="Menu1" Runat="server" CssClass="tabs" 
                                OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal" 
                                StaticMenuItemStyle-CssClass="tab" StaticSelectedStyle-CssClass="selectedTab">
                                <Items>
                                    <asp:MenuItem Selected="true" Text="Tab 1" Value="0" />
                                    <asp:MenuItem Text="Tab 2" Value="1" />
                                    <asp:MenuItem Text="Tab 3" Value="2" />
                                </Items>
                            </asp:Menu>
                            <div class="tabContents">
                                <asp:MultiView ID="MultiView1" Runat="server" ActiveViewIndex="0">
                                    <asp:View ID="Tab1" runat="server">
                                        <br />--%>
                                                </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style68" valign="top">
                            <asp:Label ID="Label46" runat="server" Text="ผู้จัดการฝ่าย MIS:"></asp:Label>
                                        <br />
                            <asp:Label ID="Label45" runat="server" Text="MIS Manager:"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                            <asp:DropDownList ID="ddlMISmanager" runat="server" Width="160px">
                            </asp:DropDownList>
                                               <div style="width: 167px"> <%--  </asp:View>
                                    <asp:View ID="Tab2" runat="server">
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                        <br />
                                        This is the second view
                                    </asp:View>
                                    <asp:View ID="Tab3" runat="server">
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                        <br />
                                        This is the third view
                                    </asp:View>
                                </asp:MultiView>
                            </div>--%></div> 
                                                </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style68">
                            <asp:Label ID="Label47" runat="server" Text="ผู้จัดการฝ่ายบัญชี:"></asp:Label>
                                        <br />
                            <asp:Label ID="Label48" runat="server" Text="Accounting Manager:"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                            <asp:CheckBox ID="ACApproveChk" runat="server" 
                                Text="(เลือกถ้าต้องการอนุมัติ)" />
                                                </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style68">
                            <asp:Label ID="Label50" runat="server" Text="ผู้จัดการทั่วไป:"></asp:Label>
                                        <br />
                            <asp:Label ID="Label49" runat="server" Text="General Manager:"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                            <asp:CheckBox ID="GMApproveChk" runat="server" Text="(เลือกถ้าต้องการอนุมัติ)" />
                                                </td>
            <td>
                &nbsp;</td>
        </tr>
        
  
        
        <tr>
            <td class="style68">
                            <asp:Label ID="Label61" runat="server" style="font-weight: 700; color: #6699FF" 
                                Text="ส่วนที่3: "></asp:Label>
                            <br />
                            <asp:Label ID="Label62" runat="server" style="font-weight: 700; color: #3399FF" 
                                Text="รายละเอียด"></asp:Label>
                                                </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                                                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        
  
        
        <tr>
            <td class="style91">
                            <asp:Button ID="btnRSI_AddTab" runat="server" Text="Add Tab" 
                                onclick="btnRSI_AddTab_Click" style="text-align: center"/>
                                                </td>
            <td class="style92">
                </td>
            <td class="style93" align="right">
                                                <asp:Button ID="btnRSI_RemoveTab" runat="server" 
                                Text="Remove Tab" onclick="btnRSI_RemoveTab_Click" />
                                                <br />
                                                </td>
            <td class="style94">
                </td>
        </tr>
        
  
        
        <tr>
            <td class="style90" colspan="4">
                            <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" 
                                onactivetabchanged="TabContainer1_ActiveTabChanged" 
                              
                                 style="margin-right: 37px" Width="600px">
                             
                                <asp:TabPanel runat="server" HeaderText="Tab 1" ID="TabPanel1">
                                    <HeaderTemplate>
                                        Tab 1
                                    </HeaderTemplate>
  
                                 <ContentTemplate>
                                  
                                 <table style="width:100%;"><tr><td class="style68">
                                     <asp:Label ID="Label56" runat="server" Text="ชื่อแพ็กเกจ:"></asp:Label>
                                     <br />
                                     <asp:Label ID="Label55" runat="server" Text="Package Name:"></asp:Label>
                                     </td><td class="style89">&#160;</td><td class="style88"><asp:TextBox ID="txtRSI_PackageName" runat="server" TextMode="MultiLine" 
                                         Height="40px" Width="180px"></asp:TextBox></td><td>&nbsp;</td></tr><tr>
                                     <td class="style68">
                                         <asp:Label ID="Label23" runat="server" Text="จำนวน Serial No:"></asp:Label>
                                         <br />
                                         <asp:Label ID="Label24" runat="server" Text="Amount of Serial No:"></asp:Label>
                                     </td><td class="style89">&#160;</td><td class="style88"><asp:TextBox ID="txtRSI_NumberOfSerials" runat="server" Width="100px"></asp:TextBox><br /></td>
                                     <td>&nbsp;</td></tr><tr><td class="style68">
                                     <asp:Label ID="Label58" runat="server" Text="ราคา:"></asp:Label>
                                     <br />
                                     <asp:Label ID="Label59" runat="server" Text="Price:"></asp:Label>
                                     </td><td class="style89">&#160;</td><td class="style88"><asp:TextBox ID="txtRSI_Price" runat="server" Width="100px"></asp:TextBox><asp:Label ID="Label60" runat="server" Text="บาท(Baht)"></asp:Label></td>
                                     <td>&nbsp;</td></tr><tr><td class="style68">
                                     <asp:Label ID="Label25" runat="server" Text="ระยะเวลาการใช้:"></asp:Label>
                                     <br />
                                     Valid Through:<br />
                                     <asp:Label ID="Label57" runat="server" Text="( ปี/เดือน/วัน)"></asp:Label>
                                     </td><td class="style89">&#160;</td><td class="style88"><asp:Label ID="Label42" runat="server" Text="Start date: "></asp:Label><br /><asp:TextBox ID="txtRSI_StartDate" runat="server" Width="100px"></asp:TextBox><asp:CalendarExtender ID="CalendarExtender2" runat="server" Format="yyyy/MM/dd" 
                                                        TargetControlID="txtRSI_StartDate" Enabled="True"></asp:CalendarExtender></td>
                                     <td>&nbsp;</td></tr><tr><td class="style87">&nbsp;</td><td class="style89">&#160;</td>
                                     <td class="style88">
                                         <asp:Label ID="Label43" runat="server" Text="End date:"></asp:Label>
                                         <br />
                                         <asp:TextBox ID="txtRSI_EndDate" runat="server" Width="100px"></asp:TextBox>
                                         <asp:CalendarExtender ID="txtRSI_EndDate_CalendarExtender" runat="server" 
                                             Enabled="True" Format="yyyy/MM/dd" TargetControlID="txtRSI_EndDate">
                                         </asp:CalendarExtender>
                                         <div style="width: 256px">
                                             <asp:CompareValidator ID="Comparevalidator2" runat="server" 
                                                 ControlToCompare="txtRSI_StartDate" ControlToValidate="txtRSI_EndDate" 
                                                 Display="Dynamic" 
                                                 ErrorMessage="*วันที่สิ้นสุดการใช้งานต้องมากกว่าวันที่เริ่มใช้งาน (The end date must be greater than start date.)" 
                                                 Operator="GreaterThan" Type="Date"></asp:CompareValidator>
                                         </div>
                                     </td><td>&nbsp;</td></tr><tr><td class="style87" colspan="3">
                                         <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                             <ContentTemplate>
                                                 <asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns="False" 
                                                     BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" 
                                                     CellPadding="4" GridLines="Horizontal" OnRowDeleting="GridView1_RowDeleting" 
                                                     ShowFooter="True" style="text-align: center">
                                                     <Columns>
                                                         <asp:BoundField DataField="RowNumber" HeaderText="Row Number" />
                                                         <asp:TemplateField HeaderText="รหัสไอเทม (Item Code)">
                                                             <ItemTemplate>
                                                                 <asp:TextBox ID="txtItemCode" runat="server">
                                                                 </asp:TextBox>
                                                             </ItemTemplate>
                                                         </asp:TemplateField>
                                                         <asp:TemplateField HeaderText="ชื่อไอเทม (Item Name)">
                                                             <ItemTemplate>
                                                                 <asp:TextBox ID="txtItemName" runat="server">
                                                                 </asp:TextBox>
                                                             </ItemTemplate>
                                                         </asp:TemplateField>
                                                         <asp:TemplateField HeaderText="จำนวน(Amount)">
                                                             <ItemTemplate>
                                                                 <asp:TextBox ID="txtItemAmount" runat="server"></asp:TextBox>
                                                             </ItemTemplate>
                                                             <FooterTemplate>
                                                                 <asp:Button ID="ButtonAdd" runat="server" onclick="ButtonAdd_Click" 
                                                                     Text="Add New Row" />
                                                             </FooterTemplate>
                                                             <FooterStyle HorizontalAlign="Right" />
                                                         </asp:TemplateField>
                                                         <asp:TemplateField HeaderText="Delete">
                                                             <ItemTemplate>
                                                                 <asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete" 
                                                                     OnClientClick="return confirm('คุณต้องการลบข้อมูลนี้หรือไม่? (Are you sure you want to delete this record?)');"> 
                                                                 Delete</asp:LinkButton>
                                                             </ItemTemplate>
                                                         </asp:TemplateField>
                                                     </Columns>
                                                     <FooterStyle BackColor="White" ForeColor="#333333" />
                                                     <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                                                     <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                                                     <RowStyle BackColor="White" ForeColor="#333333" />
                                                     <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                                                 </asp:GridView>
                                             </ContentTemplate>
                                         </asp:UpdatePanel>
                                     </td><td>
                                         &nbsp;</td></tr><tr><td 
                                             class="style95">&nbsp;</td><td class="style95"></td><td class="style95"></td><td 
                                             class="style95"></td></tr>
                                 </table>
                                 </ContentTemplate> 
                                  
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Tab 2" >
                                <HeaderTemplate>Tab 2
                                </HeaderTemplate>
                                <ContentTemplate>
                                    <table style="width:100%;"><tr><td class="style68"><asp:Label ID="Label15" runat="server" Text="ชื่อแพ็กเกจ:"></asp:Label><br /><asp:Label ID="Label16" runat="server" Text="Package Name:"></asp:Label></td><td class="style89">&#160;</td><td class="style88">
                                        <asp:TextBox ID="txtRSI_PackageNameTab2" runat="server" TextMode="MultiLine"></asp:TextBox></td><td>&#160;</td></tr><tr><td class="style68"><asp:Label ID="Label17" runat="server" Text="จำนวน Serial No:"></asp:Label><br /><asp:Label ID="Label18" runat="server" Text="Amount of Serial No:"></asp:Label></td><td class="style89">&#160;</td><td class="style88"><asp:TextBox ID="txtRSI_NumberOfSerialsTab2" runat="server" Width="100px"></asp:TextBox><br /></td><td>&#160;</td></tr><tr><td class="style68"><asp:Label ID="Label19" runat="server" Text="ราคา:"></asp:Label><br /><asp:Label ID="Label20" runat="server" Text="Price:"></asp:Label></td><td class="style89">&#160;</td><td class="style88"><asp:TextBox ID="txtRSI_PriceTab2" runat="server" Width="100px"></asp:TextBox><asp:Label ID="Label21" runat="server" Text="บาท(Baht)"></asp:Label></td><td>&#160;</td></tr><tr><td class="style68"><asp:Label ID="Label22" runat="server" Text="ระยะเวลาการใช้:"></asp:Label><br />Valid Through:<br /><asp:Label ID="Label26" runat="server" Text="( ปี/เดือน/วัน)"></asp:Label></td><td class="style89">&#160;</td><td class="style88"><asp:Label ID="Label27" runat="server" Text="Start date: "></asp:Label><br /><asp:TextBox ID="txtRSI_StartDateTab2" runat="server" Width="100px"></asp:TextBox><asp:CalendarExtender ID="CalendarExtender3" runat="server" Format="yyyy/MM/dd" 
                                                        TargetControlID="txtRSI_StartDateTab2" Enabled="True"></asp:CalendarExtender></td><td>&#160;</td></tr><tr><td class="style87">&#160;</td><td class="style89">&#160;</td><td class="style88"><asp:Label ID="Label28" runat="server" Text="End date:"></asp:Label><br /><asp:TextBox ID="txtRSI_EndDateTab2" runat="server" Width="100px"></asp:TextBox><asp:CalendarExtender ID="CalendarExtender4" runat="server" 
                                                        Format="yyyy/MM/dd" TargetControlID="txtRSI_EndDateTab2" Enabled="True"></asp:CalendarExtender><div style="width: 256px"><asp:CompareValidator ID="Comparevalidator3" runat="server" 
                                                            ControlToCompare="txtRSI_StartDateTab2" controltovalidate="txtRSI_EndDateTab2" 
                                                            Display="Dynamic" 
                                                            errormessage="*วันที่สิ้นสุดการใช้งานต้องมากกว่าวันที่เริ่มใช้งาน (The end date must be greater than start date.)" 
                                                            Operator="GreaterThan" type="Date" /></div></td><td>&#160;</td></tr><tr><td class="style87" colspan="3">

                                                 <ContentTemplate>
                                                     <asp:GridView ID="Gridview2" runat="server" AutoGenerateColumns="False" 
                                                         BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" 
                                                         CellPadding="4" GridLines="Horizontal" OnRowDeleting="GridView2_RowDeleting" 
                                                         ShowFooter="True" style="text-align: center">
                                                         <Columns>
                                                             <asp:BoundField DataField="RowNumber" HeaderText="Row Number"></asp:BoundField>
                                                             <asp:TemplateField HeaderText="รหัสไอเทม (Item Code)">
    <ItemTemplate>
                                                                 <asp:TextBox ID="txtItemCodeTab2" runat="server">
                                                                 </asp:TextBox>
                                                             
                                                             </ItemTemplate>
</asp:TemplateField>
                                                             <asp:TemplateField HeaderText="ชื่อไอเทม (Item Name)">
    <ItemTemplate>
                                                                 <asp:TextBox ID="txtItemNameTab2" runat="server">
                                                                 </asp:TextBox>
                                                             
                                                             </ItemTemplate>
</asp:TemplateField>
                                                             <asp:TemplateField HeaderText="จำนวน(Amount)">
    <ItemTemplate>
                                                                 <asp:TextBox ID="txtItemAmountTab2" runat="server"></asp:TextBox>
                                                             
                                                             </ItemTemplate>
<FooterTemplate>
                                                                 <asp:Button ID="ButtonAddTab2" runat="server" onclick="ButtonAddTab2_Click" 
                                                                         Text="Add New Row" />
                                                             
                                                             </FooterTemplate>

<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Delete">
    <ItemTemplate>
                                                                 <asp:LinkButton ID="lnkDeleteTab2" runat="server" CommandName="Delete" 
                                                                         OnClientClick="return confirm('คุณต้องการลบข้อมูลนี้หรือไม่? (Are you sure you want to delete this record?)');"> Delete</asp:LinkButton>
                                                             
                                                             </ItemTemplate>
</asp:TemplateField>
                                                         </Columns>
                                                         
                                                         <FooterStyle BackColor="White" ForeColor="#333333">
                                                         </FooterStyle>
                                                         
                                                         <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White">
                                                         </HeaderStyle>
                                                         
                                                         <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center">
                                                         </PagerStyle>
                                                         
                                                         <RowStyle BackColor="White" ForeColor="#333333">
                                                         </RowStyle>
                                                         
                                                         <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White">
                                                         </SelectedRowStyle>
                                                         
                                                     </asp:GridView>
                                                 </ContentTemplate>

                                        </td><td>
                                          
                                        </td></tr><tr><td class="style87">&nbsp;</td><td class="style89">&#160;</td><td class="style88">&#160;</td><td>
                                        &nbsp;</td></tr>
                                    </table>
                                </ContentTemplate> 
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
                                    <HeaderTemplate>
                                    Tab 3</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel4" runat="server" HeaderText="TabPanel4">
                                    <HeaderTemplate>
                                    Tab 4</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel5" runat="server" HeaderText="TabPanel5">
                                    <HeaderTemplate>
                                    Tab 5</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel6" runat="server" HeaderText="TabPanel6">
                                    <HeaderTemplate>
                                    Tab 6</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel7" runat="server" HeaderText="TabPanel7">
                                    <HeaderTemplate>
                                    Tab 7</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel8" runat="server" HeaderText="TabPanel8">
                                    <HeaderTemplate>
                                    Tab 8</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel9" runat="server" HeaderText="TabPanel9">
                                    <HeaderTemplate>
                                    Tab 9</HeaderTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel ID="TabPanel10" runat="server" HeaderText="TabPanel10">
                                    <HeaderTemplate>
                                    Tab 10</HeaderTemplate>
                                </asp:TabPanel>
                            </asp:TabContainer>
                   
                    
            </td>
        </tr>
        
  
        
        <tr>
            <td class="style68">
                            <asp:Label ID="Label63" runat="server" Text="หมายเหตุ:"></asp:Label>
                            <br />
                            <asp:Label ID="Label64" runat="server" Text="Remark:"></asp:Label>
            </td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                                                <asp:TextBox ID="txtRSI_RemarkTab2" runat="server" TextMode="MultiLine" 
                                                    Height="40px" Width="180px"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        
  
        
        <tr>
            <td class="style68">
                            &nbsp;</td>
            <td class="style67">
                &nbsp;</td>
            <td class="style34" align="right">
                                                <asp:Button runat="server" Text="Save" Width="69px" ID="Save" OnClick="Save_Click"></asp:Button>

                                     </td>
            <td>
                &nbsp;</td>
        </tr>
        
  
        
        <tr>
            <td class="style53" colspan="4">
       
            </td>
        </tr>
        
  
        
        </table>        
  
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
    <table style="width: 239px">
        <tr>
            <td class="style2">
                <asp:Label ID="lblStatus" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style2">
            </td>
            <td align="right" class="style3">
                <asp:ImageButton ID="btnLogout" runat="server" alt="Logout" Height="37px" 
                    onclick="btnLogout_Click" src="images/logout_button.png" 
                    style="height: 44px; width: 60px" Width="52px" />
            </td>
            <td>
            </td>
        </tr>
    </table>
</asp:Content>




Tag : .NET, Ms SQL Server 2008, Ajax, C#









ประวัติการแก้ไข
2012-08-17 10:29:55
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-08-17 10:26:50 By : lllnattlll View : 1312 Reply : 2
 

 

No. 1

Guest


การวางตำแหน่งน่าจะถูกแล้วครับ แต่ใน tab2 มันมี tag <ContentTemplate> เกินมาอันนึงรึเปล่าครับ
ผมลองเพิ่มให้มันเกินเหมือนกันเพราะเคยทำแบบนี้ไว้เหมือนกันแต่มันก็ error ไปเลย

ถ้าลองข้างต้นแล้ว ยังไม่ขึ้นอีก ลองเช็คต่อครับว่าเราโยนข้อมูลเข้า gridview2 แล้วหรือยัง ลองเพิ่ม tag EmptyDataText="no data" เข้าไปใน gridview2 เล่น ๆ ก่อนก็ได้ครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-17 13:31:46 By : Nebula
 


 

No. 2



โพสกระทู้ ( 8 )
บทความ ( 0 )



สถานะออฟไลน์


ตัว tag <ContentTemplate> มันไม่มีปัญหาอะไรค่ะ มีหรือไม่มี มันก็ไม่ Error


ไป Search เจอเว็บไซต์นึง มันเหมือนกับว่าต้องทำคล้ายๆ กับ บทความในเว็บไซต์นี้

http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html

แต่พอลองทำแล้ว Gridview2 ก็ยังคงไม่โหลดเหมือนเดิม

เว็บนี้โหลด Source Code มาลองทดสอบที่เครื่องก็ไม่ได้ด้วยค่ะ T_T ยากจัง !


ประวัติการแก้ไข
2012-08-17 15:36:37
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-17 15:36:04 By : lllnattlll
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยทีค่าาา ต้องการ code ที่ทำให้ GridView สามารถแสดงได้ในทุกๆ Tab Contrainer ค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่