Properly reference aspx field in code behind to populate another field

I am using the aspx calendar in a popup (so calendar will be small icon on screen).  the calendar comes up, when the image is clicked. I can select date, and then it errors out. I am it is due to syntax. I am using web froms with a master page and control pages.

I am attaching 2 files. the jpg shows online screen, and jscipt erorr. The 2nd has the code for all three files being used.

I am a newbie to .NET and relearning how to use JavaScript.
Who is Participating?
guru_samiConnect With a Mentor Commented:
Try changing the popup code like below:
<a href="javascript:;" onclick="'popup.aspx?textbox=<%=TextBox1.ClientID%>','cal','width=250,height=225,left=270,top=180')">

Open in new window

mahpogAuthor Commented:
That did the trick! My gosh, such an easy fix, when you have the expertise!  Thanks!  Is there any good book on jscript/javascript for I have been searching for one to read and learn more.
I am not sure of any such book as there isn't really anything different with javascript when using with ASP.NET.
The reason for using <%=TextBox1.ClientID%> was because it's ASP.NET that changes the ID of a field if it's inside masterpage or some other control.
mahpogAuthor Commented:
Okay. That is good to know.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.