Solved

Capturing Date OnClick of ASP Calendar using Javascript

Posted on 2009-04-08
3
464 Views
Last Modified: 2012-05-06
I am using .NET 2003 ASP.NET calendar control in C# and ASP.NET and am trying to capture the date that user clicked on and bring that into a text box in another web form. Want to use java script. Any suggestions please.
0
Comment
Question by:dotnetpro
  • 2
3 Comments
 
LVL 15

Expert Comment

by:spprivate
ID: 24098523
What you are using is a server side control and you want to do a javascript on this.
Ideal way would be to store the value in a cookie or session and on click of the calendar redirect to the next page and read the value from the cookie or session
0
 
LVL 1

Accepted Solution

by:
dotnetpro earned 0 total points
ID: 24099375
I see a bunch of rows with <href in them when i do a view source on the Calendar control...there has to be a way to hijack the __dopostback in javascript...
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 24107979
Just passed ID of the textbox as a querystring at onclick with window.open and then on the target page
i did window.opener.document.forms(0)." + hdnctrl.Value + ".value = '"; where hdnctrl is the id of a hiden control that captures the id of previouspage textbox.and then ran self.close(). This script i registered with clientscriptblock under OnSelectionChanged() event of the calendar control..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now