.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Adding Templates to DataList at Runtime

Posted By:Hefin Dsouza       Posted Date: August 13, 2009    Points: 10    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

The following code can be used for adding Dynamic Templates to the DataList Control.
You can use the TemplateBuilder class of the System.Web.UI namespace and create templates easily.

Dim headert As New System.Web.UI.TemplateBuilder
headert.AppendLiteralString("Add any thing you want in the Header Template")
DataList1.HeaderTemplate = headert
Dim footert As New System.Web.UI.TemplateBuilder
footert.AppendLiteralString("Add any thing you want in the Footer Template")
Dim Itemt As New System.Web.UI.TemplateBuilder
Itemt.AppendLiteralString("Add any thing you want in the Footer Template")

Regards Hefin Dsouza


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend