Click here to Skip to main content
11,797,355 members (80,468 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
i tried to add a calender by a popup window and everything is working fine but its not picking up date and shows a error in javascript console
Uncaught TypeError: Cannot read property 'document' of null PopupCalendar.aspx:10
SetDate PopupCalendar.aspx:10
(anonymous function)
the javascript function is
<script type="text/javascript" language="javascript">
       function SetDate(dateValue) {
           // retrieve from the querystring the value of the Ctl param,
           // that is the name of the input control on the parent form
           // that the user want to set with the clicked date
           ctl =;
           // set the value of that control with the passed date
           thisForm = window.opener.document.forms[0].elements[ctl].value = dateValue;
           // close this popup
and i wm copying it from Customizing the ASP.NET Calendar Control[^]
any suggestion....
Posted 8-May-13 22:27pm
Tadit Dash at 9-May-13 5:38am
Can you please zip your project and provide the uploaded link here ?
You can use or DropBox or any other uploading site.
Vishal Pand3y at 9-May-13 5:41am
Vishal Pand3y at 9-May-13 5:48am
there is a page addtender and PopupCalendar.aspx and control CalenderControl.ascx for that
Tadit Dash at 9-May-13 5:57am
It is big project... And it is not building it my end.
If I will try to clear those errors, then it will take time.

Instead do one thing. You said you have referred that article (the link you have provided in question), so go to that article and ask a question to him/her by putting a comment towards the bottom of article.

He might help you better.

And one more thing... You can debig line by line of the javaScript code and see where exactly it is throwing the error, may be you can get a hint, what is wrong.

Vishal Pand3y at 9-May-13 6:01am
i have tried to debug it with breakpoints it i it doesn't stop there....
Tadit Dash at 9-May-13 6:03am
Did u put debugger; inside javaScript function ?
Vishal Pand3y at 9-May-13 6:04am
no breakpoints
Tadit Dash at 9-May-13 6:20am
No, put the code
inside the function you want to debug. Then from FireBug in Firefox, you can easily debug and see the values line by line...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

check whether the code was working or not. by using alert();
Vishal Pand3y at 9-May-13 5:23am
the code is working
in JavaScript console error comes Uncaught TypeError: Cannot read property 'document' of null PopupCalendar.aspx:16
SetDate PopupCalendar.aspx:16
(anonymous function)

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

  Print Answers RSS
0 CPallini 475
1 Maciej Los 370
2 OriginalGriff 363
3 Abhinav S 344
4 Andy Lanng 296
0 OriginalGriff 2,092
1 Maciej Los 1,760
2 KrunalRohit 1,436
3 CPallini 1,245
4 ppolymorphe 893

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100