Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:


hizzzzZ

am a new programmer asp.net , but am not familiar with JavaScript

 

i have asp project which has a sign up page

in the sign up page there is textbox for date of birth

what i would to do is put a button beside that textbox when click on it a popup window appear having a asp.net calender in it , and when i choose a date from the calender , it returns a valu to textbox and close the window by self

 

?!!!!!!!?!?!?!?!?!?!??!

any help please  

Posted

You can open your popup using following javascript:

window.open("pageHavingCalendar.aspx",'mypop','height=setHeightHere,width=setWidthHere,toolbar=no,directories=no, status=no,menubar=no,scrollbars=no,resizable=no');

Then you can use delegates to handle the selecteddatechanged (some similar name) event in the page which is having the textbox. In that event you can set the textbox text and close the pop up.

 
Share this answer
 
v2
There are plenty of such calendars available on web. Search google for "javascript calendar".
 
Share this answer
 

There is a control for doing this in the ASP.Net AJAX toolkit.

This should get you started: http://www.asp.net/ajax/#6

 
Share this answer
 


my problem is not in the calender

i use asp.net calender

 

but i need to know how to make this calender popup in a new small window and retrieve a date from it to a text box

 
Share this answer
 

thank you , but i need to do it usin ShowModalDialog  :(

i use the way you told me but when trying to pick a date it make no sense

 
Share this answer
 
us this Java script Code To Show And Hid the Div:
 <pre lang="xml"><script language="javascript">;
function togglediv(divid) {
    if (document.getElementById(divid).style.display == 'none') {
        document.getElementById(divid).style.display = 'block';

    }
    else {
        document.getElementById(divid).style.display = 'none';
    }
</script>


and this int the Html Code any where :
XML
<div id="Calander" class="popup-body" align="center">
                                                 <table border="0" cellpadding="0" cellspacing="0" style="width: 96%; height: 99%;">
                                                     <tr>
                                                         <td align="right" class="popup-sp-bottom" style="height: 25px;" colspan="2">
                                                         </td>
                                                     </tr>
                                                     <td style="text-align: center;">
                                                     <asp:Calendar ID="calMyCal" runat ="server" ></asp:Calendar>
                                                     </td>
                                                     </tr>
                                                     <tr>
                                                         <td align="left"   style="height: 20px;" colspan="2">
                                                             <a class="popup-close" href="javascript:;" onclick="togglediv('Calander');">
                                                             Close
                                                             </a>
                                                         </td>
                                                     </tr>
                                                 </table>
                                             </div>



in the Head u will Write This :


<pre lang="css">
.popup-body
{
width:auto;
height:auto;
display:none;
position:fixed;
z-index:999999999;
top:40%;/*----determine the top -----*/
left:30%;/*----determine the left margin-----*//*---------*/
vertical-align:middle;
border:solid 2px #006248;
}
</pre>



To Show The pop Us Markup:
<a href="javascript:;" onclick="togglediv('Calander');">Show Calander</a>

Ibraheem Abulubbad

.Net Developer
 
Share this answer
 

i really appreciate that , but in fact all my work is a task

and i have to do it exactly the way i asked you

 

thanks all again

and sorry for being noisy

 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900