Question : Asp.net Calender Control and JQuery

IDE: ASP.Net 2008
Language: C#, JQuery

Task: I am creating an asp.net page, with a button called, 'Set Appointment".  Using Jquery, when the user selects the "set appointment" button, a div (which contains some controls with in a table) appears and allows the user to select a date from an asp.net calender control.  when all the controls are populated (within the div), the user selects an update button, the database is updated and the div disappears.

Problem: if the user selects a date on the asp.net calender control the div disappears, not allowing the user finishing setting up the appointment.  

Other Information: I don't have a problem hiding and unhiding the div, I just need the div not to disappear when the user selects a date from the calender control, however, I still need the asp.net calender control to function as normal.  I can't use $e.preventDefault on the calender control because then the user will not be able to select a date.  I know I can add a runat server attribute to the div and do this without using jQuery. But is it possible to do this using JQuery?  If so can somene help me?  ~thanks in advance.

Answer : Asp.net Calender Control and JQuery

Can suggest you a work around for this type of problem

1. Place a textbox on page with style="display:none"
2. You can set the value to zero, identifying as the div is hidden.
3. When the show div is called set the value of this control to 1. i.e. the control is visible
4. You need to switch the value of text ox between 0 and 1.
5. Place the code at the end of page as
<script type="">
   if(document.getElementById('txtboxHidden').value == '1')
   {
      //Display your Div code here
   }
</script>

Hope this will help you
Random Solutions  
 
programming4us programming4us