Hallo everyone..
can anyone assist me on how to disable previous date on the asp.net calender.
i create this application using microsoft visual web developer 2005 express edition..
the calender i expected is will automatically disabled the previous date.
eg. today is 23/3/2010. the calender will disable the all the date before 23/3/2010.that is from 22/3/2010 back
i am developing a ticket reservation system for my education project.
hope you all might assist me..
i appreciate a alot for your kindness..
here my coding is given below.
Imports System.Text
Imports System.Web.UI.LiteralControl
Namespace VbNetTest
Partial Class DatePicker
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Calendar1.SelectionChanged
'Nothing to do, here
End Sub
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
'// Clear the link from this day
e.Cell.Controls.Clear()
'// Add the custom link
Dim Link As System.Web.UI.HtmlControls.HtmlGenericControl
Link = New System.Web.UI.HtmlControls.HtmlGenericControl
Link.TagName = "a"
Link.InnerText = e.Day.DayNumberText
Link.Attributes.Add("href", String.Format("JavaScript:window.opener.document.{0}.value = '{1:d}'; window.close();", Request.QueryString("field"), e.Day.Date))
'// By default, this will highlight today's date.
If e.Day.IsSelected Then
Link.Attributes.Add("style", Me.Calendar1.SelectedDayStyle.ToString())
End If
'// Now add our custom link to the page
e.Cell.Controls.Add(Link)
End Sub
End Class
End Namespace
please help me...........