0
我使用列表視圖控件打印數據。我在itemtemplate中使用了LinkButton。我希望列名不應該打印......................................... ............ 我必須做出什麼改變?Asp.net和ListView控件
<asp:ListView ID="ListView1" runat="server" DataKeyNames="userid" DataSourceID="SqlDataSource1">
<AlternatingItemTemplate>
<tr style="">
<td>
<asp:Label ID="catgLabel" runat="server" Text='<%# Eval("catg") %>' />
</td>
<td>
<asp:Label ID="useridLabel" runat="server" Text='<%# Eval("userid") %>' />
</td>
<td>
<asp:Label ID="datetimeLabel" runat="server" Text='<%# Eval("datetime") %>' />
</td>
</tr>
</AlternatingItemTemplate>
<EditItemTemplate>
<tr style="">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
</td>
<td>
<asp:TextBox ID="catgTextBox" runat="server" Text='<%# Bind("catg") %>' />
</td>
<td>
<asp:Label ID="useridLabel1" runat="server" Text='<%# Eval("userid") %>' />
</td>
<td>
<asp:TextBox ID="datetimeTextBox" runat="server" Text='<%# Bind("datetime") %>' />
</td>
</tr>
</EditItemTemplate>
<EmptyDataTemplate>
<table runat="server" style="">
<tr>
<td>No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
</td>
<td>
<asp:TextBox ID="catgTextBox" runat="server" Text='<%# Bind("catg") %>' />
</td>
<td>
<asp:TextBox ID="useridTextBox" runat="server" Text='<%# Bind("userid") %>' />
</td>
<td>
<asp:TextBox ID="datetimeTextBox" runat="server" Text='<%# Bind("datetime") %>' />
</td>
</tr>
</InsertItemTemplate>
<ItemTemplate>
<tr style="">
<td>
<asp:Label ID="catgLabel" runat="server" Text='<%# Eval("catg") %>' />
</td>
<td>
<asp:Label ID="useridLabel" runat="server" Text='<%# Eval("userid") %>' />
</td>
<td>
<asp:Label ID="datetimeLabel" runat="server" Text='<%# Eval("datetime") %>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table id="itemPlaceholderContainer" runat="server" border="0" style="">
<tr runat="server" style="">
<th runat="server">catg</th>
<th runat="server">userid</th>
<th runat="server">datetime</th>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style=""></td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="">
<td>
<asp:Label ID="catgLabel" runat="server" Text='<%# Eval("catg") %>' />
</td>
<td>
<asp:Label ID="useridLabel" runat="server" Text='<%# Eval("userid") %>' />
</td>
<td>
<asp:Label ID="datetimeLabel" runat="server" Text='<%# Eval("datetime") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
顯示您的代碼.. –
你能看到代碼嗎? –
問題已解決:P –