Reputation: 1437
When I create InsertItemTemplate in ListView control, it doesn't appear. Why ? Where is the problem here in this code ? I cannot see "Enter text" with TextBox control when I run it.
<asp:ListView ID="ChatListView" runat="server" DataSourceID="EntityDataSourceUserPosts" OnItemDataBound="ChatListView_ItemDataBound">
<ItemTemplate>
<div class="postContent">
<%# Eval("PostComment") %>
</div>
</div>
</ItemTemplate>
<InsertItemTemplate>
<asp:Label ID="Label2" runat="server" Text="ENTER TEXT"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</InsertItemTemplate>
</asp:ListView>
Upvotes: 0
Views: 983
Reputation: 356
Are you setting the InsertItemPosition like below:
protected void btn_Click(object sender, EventArgs e)
{
ChatListView.InsertItemPosition = InsertItemPosition.FirstItem;
}
Upvotes: 1