在Templatefield中添加asp表

时间:2014-02-19 04:55:48

标签: html asp.net vb.net templatefield

这里我在gridview中的模板字段中添加asp表有问题。  在我的gridview中有一个按钮被命名为“View”,当我点击它时它应该显示该行下方的所有信息...所以我该怎么做?我应该使用模板字段??如何使用此模板字段为每行添加按钮(“查看”) 请更正我的代码

     <asp:TemplateField HeaderText="View">
                        <ItemTemplate>
                            <asp:Table ID="tblModify" runat="server" Width="100%" Visible="False" CssClass="table">
                                <asp:TableRow>
                                    <asp:TableCell ID="TableCell35" runat="server" HorizontalAlign="Right"><h1>Debit Information</h1></asp:TableCell>
                                    <asp:TableCell></asp:TableCell>
                                    <asp:TableCell></asp:TableCell>
                                    <asp:TableCell></asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow ID="TableRow6" runat="server">
                                    <asp:TableCell ID="TableCell3" runat="server" HorizontalAlign="Right">DebitNoteNumber</asp:TableCell><asp:TableCell
                                        ID="TableCell4" runat="server">
                                        <asp:Label ID="lblDebitNoteId" runat="server" MaxLength="50" Columns="70" />
                                    </asp:TableCell><asp:TableCell ID="TableCell5" runat="server" HorizontalAlign="Right">Date</asp:TableCell><asp:TableCell
                                        ID="TableCell6" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblDate" runat="server" MaxLength="30" Columns="50"></asp:Label>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow ID="TableRow1" runat="server">
                                    <asp:TableCell ID="TableCell11" runat="server" HorizontalAlign="Right">Patient Name</asp:TableCell><asp:TableCell
                                        ID="TableCell37" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblPatientName" runat="server" MaxLength="50" Columns="70"></asp:Label>
                                    </asp:TableCell>
                                    <asp:TableCell ID="TableCell1" runat="server" HorizontalAlign="Right">Patient Number</asp:TableCell><asp:TableCell
                                        ID="TableCell2" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblPatientId" runat="server" MaxLength="50" Columns="70"></asp:Label>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow ID="TableRow2" runat="server">
                                    <asp:TableCell ID="TableCell38" runat="server" HorizontalAlign="Right">Phone Number</asp:TableCell><asp:TableCell
                                        ID="TableCell39" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblPatientPhoneNumber" runat="server">  </asp:Label>
                                    </asp:TableCell>
                                    <asp:TableCell ID="TableCell7" runat="server" HorizontalAlign="Right">Bill Number</asp:TableCell><asp:TableCell
                                        ID="TableCell8" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblBillId" runat="server">  </asp:Label>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow ID="TableRow5" runat="server">
                                    <asp:TableCell ID="TableCell9" runat="server" HorizontalAlign="Right">Receipt Number</asp:TableCell><asp:TableCell
                                        ID="TableCell10" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblReceiptId" runat="server" MaxLength="30" Columns="50"></asp:Label>

                                    </asp:TableCell><asp:TableCell ID="TableCell13" runat="server" HorizontalAlign="Right">Amount</asp:TableCell><asp:TableCell
                                        ID="TableCell14" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblAmount" runat="server" MaxLength="30" Columns="50"></asp:Label>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow ID="TableRow8" runat="server">
                                    <asp:TableCell ID="TableCell15" runat="server" HorizontalAlign="Right">Balacne</asp:TableCell><asp:TableCell
                                        ID="TableCell16" runat="server" HorizontalAlign="Left">
                                        <asp:Label ID="lblBalacne" runat="server" MaxLength="30" Columns="50"></asp:Label></td>
                                    </asp:TableCell><asp:TableCell></asp:TableCell><asp:TableCell></asp:TableCell>
                                </asp:TableRow>
                            </asp:Table>
                        </ItemTemplate>
                    </asp:TemplateField>

如果我使用此代码,我在网格视图中找不到按钮(“查看”)...

1 个答案:

答案 0 :(得分:0)

你可以使用Modal Pop Up Extender。 将简单的html表标签(TR,TD)与服务器端标签一起写入模式弹出窗口。当您单击&#34;查看&#34;详细信息将显示在Modal弹出窗口中。