How to create datetimepicker dynamically(without class) in asp.net with C#? -


i want create datetimepicker dynamically. have reviewed few reference suggest create class , assign textbox control has created dynamically(http://www.ashishblog.com/assign-datepicker-to-runtimedynamic-textboxes-in-asp-net-using-jquery/). want create datetimepicker dynamically in .cs file without support of class.

i.e text control

textbox textcontrol = new textbox(); textcontrol.id = "txt_id"; textcontrol.text = ""; textcontrol.autopostback = true; textcontrol.textchanged += textcontrol_textchanged; ; mainplaceholder.controls.add(textcontrol); 

can please suggest me link or lines of code?

first install or download manually , paste in codebase

nuget

install-package bootstrap.datepicker

then follow along

 <link href="content/bootstrap.min.css" rel="stylesheet" />     <link href="content/bootstrap-datepicker.css" rel="stylesheet" />     <script src="scripts/jquery-1.10.2.js"></script>     <script src="scripts/bootstrap.js"></script>     <script src="scripts/bootstrap-datepicker.min.js"></script>     <div id="add">         <input type="text" name="datepicker " value=" " class="form-control mytimepicker" />         <button id="addmore">addmore</button>     </div>     <script>         $(function () {             $(document).on('focus', '.mytimepicker', function (e) {                 $(this).datepicker({                     autoclose: 'true'                 });             });              $('#addmore').click(function (e) {                 e.preventdefault();                 $('#add').append('<input type="text" name="datepicker " value=" " class="form-control mytimepicker" />');             });         });     </script> 

more info datepicker bootstrap-datepicker


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -