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


Top 5 Contributors of the Month
david stephan

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")
DataList1.FooterTemplate=footert
Dim Itemt As New System.Web.UI.TemplateBuilder
Itemt.AppendLiteralString("Add any thing you want in the Footer Template")
DataList1.ItemTemplate=ItemT



Regards Hefin Dsouza

     

Further Readings:

Responses

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