Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2004, 05:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default Calendar Control

Is there a way to turn off the postback or the day links altogether for the calendar control?

 
Old January 27th, 2004, 06:25 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Use the DayRender event of the caledar control, and set the day item IsSelectable to false:

Private Sub calEndDate_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles calEndDate.DayRender
    e.Day.IsSelectable = False
End Sub

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 28th, 2004, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

That worked thanks.

Is there a way to handle, if IsSelectable is set to true, the day clicks? For example, if someone clicks a day it pops up a window with information on that day.

 
Old January 28th, 2004, 11:22 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The .net Calendar control is a server control. If doesn't provide any native functionality for client side events. Add this to your DayRender handler:

e.Cell.Attributes.Add("onClick", String.Format("alert('{0}');", e.Day.Date))
e.Cell.Style.Add("cursor", "hand")

Modify the onclick client string to open your window.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar control cJeffreywang ASP.NET 2.0 Basics 2 July 4th, 2007 01:05 PM
Calendar Control Brendan Bartley Access 4 September 8th, 2006 03:58 AM
Calendar Control with Tab Control Slicemahn Access 1 June 12th, 2006 10:35 PM
Multiday Calendar Control Alcapone C# 1 August 31st, 2004 04:52 PM
Calendar Control ActiveX - Where umagrama Access VBA 0 December 9th, 2003 01:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.