Solved

Calendar control and PostBack issue

Posted on 2012-04-11
2
430 Views
Last Modified: 2012-04-12
I have a web form with a button (button1) and a div with dropdownlis, a bunch of texbox controls on it, a button(button2) and a calendar control.

The div and its elements are not visible until user clicks on button1 - the only control visible on the form. I use JQuery to make the div and its elements visible.

her is my JQuery code:

$(document).ready( function(){
	 $('#div1').css('display', 'none');
                 $('#button1').click(function(e){
	         e.preventDefault();
	         $('#div1').css('display', 'block'); 
	 });
 });

Open in new window


So when I click on button1, my div1 becomes visible, I select and item from a dropdown, then I click on a calendar control to select a value and my div becomes invisible. it reatins all the selections and re-appears if I click on button1 once again, but it is not satisfactory. I tried preventing a postback of calendar control but then it does not retain a selection in the calendar control.

How do i get around this issue?
0
Comment
Question by:YZlat
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 37837321
0
 
LVL 35

Author Comment

by:YZlat
ID: 37837677
UpdatePanel worked for me. Thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 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

14 Experts available now in Live!

Get 1:1 Help Now