calendar control
-
hi, i am using an asp calendar control. i have written code for onSelectedIndexChange for the calendar control. but whenever i click on the calendar control, the whole page is getting refreshed. there is no autopostback property in the calendar control to stop refreshing the page. can anybody help me plz....
scarface
-
hi, i am using an asp calendar control. i have written code for onSelectedIndexChange for the calendar control. but whenever i click on the calendar control, the whole page is getting refreshed. there is no autopostback property in the calendar control to stop refreshing the page. can anybody help me plz....
scarface
Can you show the code you have written..?
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
-
Can you show the code you have written..?
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
hey, thanks for such a quick reply.... i have a button, which when clicked, opens the calendar(calendar is inside a div whose display is none in the begining. when button is clicked, the display is 'block', so the calendar shows up.) but when a value is selected in a calendar(server control), the whole page is refreshed and the div display is 'none' again. this happens everytime i click on the calendar control....
scarface
-
hi, i am using an asp calendar control. i have written code for onSelectedIndexChange for the calendar control. but whenever i click on the calendar control, the whole page is getting refreshed. there is no autopostback property in the calendar control to stop refreshing the page. can anybody help me plz....
scarface
Rather than using ASP.Net calendar, you can go for any Java Script Calendar. or use Ajax Update panel to solve your problem.
cheers, Abhijit CodeProject MVP
-
hey, thanks for such a quick reply.... i have a button, which when clicked, opens the calendar(calendar is inside a div whose display is none in the begining. when button is clicked, the display is 'block', so the calendar shows up.) but when a value is selected in a calendar(server control), the whole page is refreshed and the div display is 'none' again. this happens everytime i click on the calendar control....
scarface
scar_face wrote:
when a value is selected in a calendar(server control), the whole page is refreshed
That's the way it behaves...The Calendar control included with ASP.NET uses postbacks only. If you don't want the users to notice it use AJAX update panel and keep the Calender control inside it.(Or else you can write your own javascript calender.There are plenty of them available on the web).
scar_face wrote:
and the div display is 'none' again
You need to run the javascript again...You have the register the clientscript and run the script again once the page refreshes.(Or else set the display: block again)
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
-
hi, i am using an asp calendar control. i have written code for onSelectedIndexChange for the calendar control. but whenever i click on the calendar control, the whole page is getting refreshed. there is no autopostback property in the calendar control to stop refreshing the page. can anybody help me plz....
scarface
Standard ASP.NET Calendar control will always do the postback. It is better to use the JavaScript, DHTML Calendar Controls. So many free JavaScript, DHTML Calendar controls are available free in the web. You can also use the AJAX calendar Control which will not do full postback. If you want to strict with the Standard ASP.NET calendar control, then I would suggest you to use AJAX Update Panel which removes full post backs.
Either you love IT or leave IT...