Reputation: 389
I have a ListView control with an ItemTemplate
, and an EditItemTemplate
. By default, the ItemTemplate
is rendered; how can I change that? More clearly, on Page_Load, I would like my EditItemTemplate
to be the selected template.
<asp:ListView ID="lvExample" runat="server" SelectMethod="GetStuff" UpdateMethod="UpdateStuff">
<EditItemTemplate>
...
</EditItemTemplate>
<EditItemTemplate>
...
</EditItemTemplate>
</asp:ListView>
Upvotes: 1
Views: 593
Reputation: 857
You can use this approach. (1) Write your Edit logic/Edit Template in your inside you item template. (2) Then you can put your ItemTemplate content into another template.
since the default load template is ItemTemplate you get your edit template load first since the content of your itemteplate is your edit template
Upvotes: 1