-1

I am developing an application using .Net. I want to implement datetime picker in my application.

 $(document).ready(function(){
            $('#MainContent_txtTime').datetimepicker();
        });

The textbox 'MainContent_txtTime' control has been placed inside an ajax popup extender and the datetimepicker is not visible as it is opening behind the popup extender. The popup is placed inside an accordion. How could I show it above the textbox?

I have used following .css class

<style type="text/css">
        #ui-datepicker-div {
            z-index: 9999999;
        }
    </style>

It is not working. Any clue?

Thanks

Partha
  • 469
  • 2
  • 14
  • 32

1 Answers1

1

You can use bootstrap datetimepicker with easy way like below:-

You need to add just jquery, datetimepicker scipt, datetimepicker css.

$(function(){
  $('.datepicker').datetimepicker();
})
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>



<div style="position:relative">
<input type="text" class="datepicker">
</div>
Rohit Verma
  • 3,657
  • 7
  • 37
  • 75
  • Not working inside ModalPopupExtender ... datetimepicker is opening behind the popup extender. – Partha Dec 19 '18 at 11:15
  • which modal popup you are using its bootstrap modal? if its bootstrap then which bootstrap version are you using? – Rohit Verma Dec 19 '18 at 11:16
  • I am using Ajax popup extender and bootstap .js and .css version 3.0.0 (default with .net VS). – Partha Dec 19 '18 at 16:19