Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Newbie: Calendar question?

Reply
Thread Tools

Newbie: Calendar question?

 
 
JM
Guest
Posts: n/a
 
      07-14-2006
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


 
Reply With Quote
 
 
 
 
andrew
Guest
Posts: n/a
 
      07-14-2006

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:
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar GadGets does not show calendar iccsi Windows 64bit 4 08-14-2011 01:52 PM
How to Synchronise Hotmail Calendar with Standard Outlook Calendar using Outlook Connector ?? Synapse Syndrome Computer Support 0 12-02-2007 04:19 AM
Thunderbird Calendar with Exchange 2003 Calendar and Public FoldersCalendar jincmcse Firefox 1 09-03-2005 02:46 AM
Calendar Control - Programatically set the calendar to a date range Shevek ASP .Net 3 06-23-2004 01:41 PM
Calendar Control - Programatically set the calendar to a date range Shevek ASP .Net Web Controls 0 06-23-2004 12:06 PM



Advertisments