I have a ListView that I want to output both a THEAD and a TBODY element. Currently it just outputs a TABLE and TBODY followed by the heading and data contents in separate TR elements. My LayoutTemplate is below. What am I missing?
Just remove the runat="server" attribute from the <table> tag inside your listview layout template control.Also I have removed the same from <th> tags , if you are not accessing them from server side. Check the modified code below
Member
353 Points
1550 Posts
ListView not creating thead
Dec 16, 2016 09:03 PM|dlchase|LINK
I have a ListView that I want to output both a THEAD and a TBODY element. Currently it just outputs a TABLE and TBODY followed by the heading and data contents in separate TR elements. My LayoutTemplate is below. What am I missing?
Member
370 Points
137 Posts
Re: ListView not creating thead
Dec 17, 2016 08:48 AM|Nilishere|LINK
Just remove the runat="server" attribute from the <table> tag inside your listview layout template control.Also I have removed the same from <th> tags , if you are not accessing them from server side. Check the modified code below
Let me know if it works for you. The table is treated as server side control with the runat="server" attribute. Check the below link
http://www.java2s.com/Tutorial/ASP.NET/0380__Data-Binding/UseaListViewcontroltorenderanHTMLtable.htm