Sorry fr2, that was a before coffee answer.
The Calendar control will only display and return date information. If you need time information then you have to use a control similar to Outlook's scheduler.
If you need it at "12:00AM" then you could append that onto the date the control returns.
If the user needs to pick a date then you're kinda stuck.
Unless you want to subclass the datetime control.
Sorry, did that answer it? I've always bought whatever control does what I want but my current company is um "thrifty" LOL, and I don't have that luxury here.
bigfoot:
Hmm .. this is getting trickier .. and about to throw in the towel!
"If you need it at "12:00AM" then you could append that onto the date the control returns"
The problem is the calender control and the associated textbox is contained in a formview control .. so the controls are not visible when I go to the page-behind code to write code to grab the date selected .... plus the date is selected from the calendar prior to clicking the "Update" buttom on the formview .. so its all kinda jacascript that inserts the date into the textbox ... all kinda behind the scenes ...
Do you know of how I would grab the date returned from within a formview control?
jmeckley:
"if you select a date then it automatically defaults the time to 12:00 am."
Are u sure? I went to the link u provided and I selected several different dates to test and only the date shows, no time
fr2, are you using the Ajax Calendar control, or the New 2.0 version?
And I feel your pain on the FormView but there's an excellent workaround. Any control in the formview can be had with FindControl, and it's easy to code.
Say you're looking for a textbox. It would work like this:
Dim text As String = DirectCast(DataView1.FindControl("myTextbox"), Label).Text
This would assign the value of the textbox to text, but you could also create an object of type Webcontrols.Textbox and use it.
But in your case you don't have to.
in your Calendar inside your FormView, there's a Format command that looks like this:
Format="MMMM d, yyyy" Do as jmeckley suggests and change it to: Format="MMMM d, yyyy hh:mm:ss". It will come out as 12:00:00
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.