How to call the Page_load procedure from any event on the page
VB.NET Dim strval As String = ‘a’ If strval = ‘a’ Then Call Page_Load(sender, e) End If C# string strval =’a’; if( strval ==’a’) { Page_Load(sender,e); }
How can I use a Calendar Control in readonly mode. i.e no links for the day and month cells.
In the DayRender Event of calendar Control VB.NET If e.Day.IsOtherMonth Then e.Cell.Text = ‘ ‘ Else e.Cell.Text = e.Day.DayNumberText End If C# if (e.Day.IsOtherMonth ) { e.Cell.Text = ‘ ‘; } else { e.Cell.Text = e.Day.DayNumberText; }
How to highlight today’s date in Calendar Control in different color
In Calendar DayRender Event VB.NET If e.Day.IsToday Then e.Cell.ForeColor = Color.Blue e.Cell.BackColor = Color.Pink End If C# if (e.Day.IsToday) { e.Cell.ForeColor = Color.Blue; e.Cell.BackColor = Color.Pink; }
How to hide ‘other months’ in a Calendar Control
In the Calendar DayRender Event VB.NET If e.Day.IsOtherMonth = True Then e.Cell.Text = ” End If C# if (e.Day.IsOtherMonth = true) { e.Cell.Text = ”; }
How to hide the WeekDay Header in the Calendar control
In the Calendar PreRender Event VB.NET Calendar1.ShowDayHeader = False C# Calendar1.ShowDayHeader = false;