?
Solved

Capturing Date OnClick of ASP Calendar using Javascript

Posted on 2009-04-08
3
Medium Priority
?
536 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

807 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