|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Newbie: Calendar question?Hi,
I am new to asp.net, I need to show the calendar control with some days that can be picked by the user and other days that cannot. Please is there any property that allow me to "disabled" one specific day so it can not be picked?, Is there any property that allow me to "disabled" and entire month, so I can show up the month but the user can not picked up any day?. Thanks, Jaiem I had the same problem, Basically i needed to make a calendar control
that a user could picks dates from but i only wanted the users to be able to pick dates that were valid pay days. You can handle the calendar dayRender function. Here is a short example of how i did this. Public Sub calDatePicker_DayRender(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles calDatePicker.DayRender Dim Link As HtmlGenericControl = New HtmlGenericControl ' Clear the link from this day e.Cell.Controls.Clear() ' Add the custom javascript link Link.InnerText = e.Day.DayNumberText If GlobalFunctions.IsPayDay(e.Day.Date) Then Link.TagName = "a" Link.Attributes.Add("href", "javascript:window.opener.document.getElementById('" & Request.QueryString("field") & "').value = '" & e.Day.Date & "'; window.close();") e.Day.IsSelectable = True Else e.Day.IsSelectable = False End If ' Highlight today's date If (e.Day.IsSelected) Then Link.Attributes.Add("style", calDatePicker.SelectedDayStyle.ToString()) End If If Not e.Day.IsOtherMonth Then ' Add customer link to calendar picker page e.Cell.Controls.Add(Link) Else e.Cell.Text = "" End If End Sub Good luck, let me know if you have any other questions. Cheers, Andrew JM wrote: Show quoteHide quote > Hi, > > I am new to asp.net, I need to show the calendar control with some days that > can be picked by the user and other days that cannot. Please is there any > property that allow me to "disabled" one specific day so it can not be > picked?, Is there any property that allow me to "disabled" and entire month, > so I can show up the month but the user can not picked up any day?. > > Thanks, > > Jaiem
Hyperlink control - embedded spaces converted
Auto Postback Handling in controls Setting Properties in a Composite Control... How to have either/or steps in a wizard WebPartManager1.CloseWebPart Error Programmatically listening for an event? Can't install iewebcontrols.msi - error "webctrl_client is unavailable" Multi-line textbox scrolled to bottom? Problem handling event in a button inside a Datalist UserControl loaded dynamically multiple times on same page....client js problem |
|||||||||||||||||||||||