The problem with the Calendar is that it is not a databound control. Therefore, you cannot 'push' data into it, nor is there any template that you can create the layout for each calendar day. Even the Link Button itself that the Calendar creates is created via a String rather than a proper Link Button. Is Post Back Then Load Some Data() End If End Sub Protected Sub Load Some Data() ' load some example dates into our page variable Data Table ' Me._List Of Dates = New Data Table Me._List Of Dates. Add(New Data Column("Event Date", Get Type(Date Time))) Me._List Of Dates. Add(New Data Column("Event Description", Get Type(String))) Dim dr As Data Row = Me._List Of Dates.
Quite often coders wish to change the functionality/appearance of the ASP. After helping someone on Experts Exchange the other day, I realised that this isn't quite as easy as you'd expect.
People are constantly asking the following types of questions: Update: If you are looking to create a calendar from scratch without using the Asp: Calendar control, please check this post instead: Create an ASP.
NET calendar without using the asp: Calendar control.
Otherwise if you want to modify the existing Calendar control's output, read on... Item("Event Description") = "Bob's birthday" Me._List Of Dates.
Item("Event Description") = "Get job at Microsoft" Me._List Of Dates.
Item("Event Description") = "Get promoted at Microsoft" Me._List Of Dates.
Item("Event Description") = "Demand massive pay rise" Me._List Of Dates.
In this post I will share the technique required for modifying the calendar contents: Because the Link Button is created using an internal String Builder, the Link Button cannot be modified. Day Render ' create link Button first (omitted for brevity) ' my Link Button ID.
The only solution is to clear it from the calendar day table cell, then re-create your own. Microsoft have clearly noted that the above would usually make the Calendar very hard to modify.