Click here to Skip to main content
Click here to Skip to main content

DotNet TimePicker control

By , 25 Jul 2007
Rate this:
Please Sign up or sign in to vote.

Introduction

TimePicker is quiet a simple control which displays 3 dropdownlist with 'Hours',' Minutes' and 'Am/Pm' for display and selection. The control gets rendered as shown below. The 'DotNet_TimePicker.zip' contains the document with images showing the usage.

Using TimePicker is just as easy. Drag the 'TimePicker.ascx' into the page where you want use it.

Using the code

Time Picker control has 4 public property Hour, Minute, AmPm and Time. This control when added to a page renders 3 drpdown of Hour, Minute and AmPm.

The 'Time' property can be used directly to get a combined time attributes to be pushed into the DataBase. TimePicker.Time returns the Time in 24Hour format. i.e 15:36:00 The TimePicker has 'set' property of 'Time' eg

//
//   TimePickerTo.Time = "20:48:00";

//

This will set the TimePicker dropdown to 04:48 PM

The TimePicker has inbuilt requiredfield Validators too.

To see the usage download the code and run it as 'website' set 'Default.aspx' as the startup page.

Conclusion

I have deliberately kept very little frills to the control to make is more flexible. The code is available in download. Go ahead and add more feature to it. Its yours for free Smile | :) !

Happy Coding!!

Adarsh Nair

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Adarsh N
Web Developer
India India
Compulsive coder

Comments and Discussions

 
GeneralError PinmemberVeesam Suresh Kumar14-Jun-07 17:28 
GeneralRe: Error PinmemberAdarsh N24-Jul-07 18:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 25 Jul 2007
Article Copyright 2007 by Adarsh N
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid