Calendar Control & Client-Side Functionality

A

Alex Maghen

Hi. I want to use the nice "Calendar" control (<asp:Calendar>) but I want to
use it to populate a TextBox on the client-side without doing a server
round-trip. Is this possible with this control? If so, how do I do it?

Alex
 
S

Steven Cheng[MSFT]

Hi Alex,

Thank you for posting.

As for the ASP.NET Calendar control, so far it is still concentrating on
server-side processing, and there hasn't pure client-side based interfaces
to let us manipulate it at client-side(like AJAX ...). Also for your
scenario, you want to populate a textbox with date value supplied in
Calendar control, generally we will need to use two separate pages to do
it. One page is the main page which contains the textbox, and another is a
page contains the Calendar and this page will be opened as a popup page to
let user select Date. Here is a web article which has mentioned this
approach:

http://www.mikepope.com/blog/DisplayBlog.aspx?permalink=501&count=no

Also, based on my review on the article, there is one place we need to
change. Since the Calendar control will still postback when selected Date
changes, we need to use server code to embeded the new selected value into
client script. e.g:

==============
<script language=javascript>
window.opener.document.all[control].value = '<%=
Calendar1.SelectedDate.ToString()%>'
window.close();

</script>
==============

BTW, if you do need pure client-side based approaches, there exists some
3rd party calendar or web based DateTimePicker controls available. You can
try searching in the www.asp.net or codeproject ...

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi Alex,

Does the info in my last reply helps you some on this issue? If there's
still anything we can help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,740
Latest member
AdolphBig6

Latest Threads

Top