Last post Nov 12, 2005 08:55 PM by imagemaker
Nov 12, 2005 02:39 PM|zguoqi|LINK
I know asp.net has a calendar control, but that is not exactly what I want. What we like is a popup calendar control. when user click a calendar icon, a popup is open for user to select the date.
Is there is standard control in DotNetNuke to do this? or how can I archieve this?
Nov 12, 2005 05:32 PM|brian_c|LINK
Nov 12, 2005 08:55 PM|imagemaker|LINK
If you're thinking of the pop-up calendar that seems standard for date entry in many of the core tabs, add a hyperlink control to your .ascx file as follows (taken from my first custom module that I'm now writing):
<td class="SubHead" align="right" width="15%">Membership Expires:</td>
<td class="NormalBold" align="left" width="35%">
<asp:textbox id="tbMembershipExpires" runat="server"
Then, in the code-behind, add the following to the Page_Load event so that it is run both on the initial load and on all postbacks:
cmdMembershipExpiresCalendar.NavigateUrl = CType(DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(tbMembershipExpires), String)
Note that you will be passing a reference to the textbox that will receive the selected date in the call to InvokePopupCal.
I did not initially like the DNN popup calendar, preferring to use something like a drop-down list based date picker, but after seeing it used in so many modules, decided to go with what comes as standard in DNN.