Calendar...

D

David Lozzi

Hi,

Thanks for your help. I'm using the calendar control for the first time. I'm
squaring away the formatting and everything, but I have an interesting
scenario, not sure if its possible:

I'd like the calendar to appear only when asked for. I.e., the user is
presented with a textbox to input the date, if they want, then can click an
image to the right to display a calendar, then select the date. The newly
selected date would fill the date textbox.

I can do this with some javascript, but I'm wondering if its possible with
the provided controls.

Thanks!

David Lozzi
 
G

Guest

I haven't done it before but you should be able to do it like this:

1) Design a page with only the calendar control.
2) Add a javascript function to the page that will update a textbox located
on a parent window and then close the current window.
3) Use the RegisterClientScriptBlock method to call the javascript function
when a user clicks a date.
4) Add a link next to the textbox where the date will go, and when the user
clicks it the calendar page will open up. Don't forget to pass the name the
control to the child window. (You could hardcode it but you'll be able to
reuse it if you don't).

OR you could simply add the calendar to the page with the date textbox and
set the calendar's visible property to false. When the user clicks the link
the page will reload and dispaly the calendar which can be used to set the
date. As long as the viewstate is enabled for the other controls on the page
you won't have to worry about preserving the user entered values.

Regards,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top