Solved

Capturing Date OnClick of ASP Calendar using Javascript

Posted on 2009-04-08
3
451 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

19 Experts available now in Live!

Get 1:1 Help Now