textboxes are empty on postback with bootstrap modal asp.net

前端 未结 4 2166
野趣味
野趣味 2021-02-15 23:59

I am using bootstrap modal in my asp.net page like this:

   
4条回答
  •  南笙
    南笙 (楼主)
    2021-02-16 00:25

    I just had similar problem. I resolved this by moving the modal element inside the form element using jquery.

       function init() {
            var element = $('#myModal').detach();
            $($("form")[0]).append(element);        
        }
    
        window.addEventListener('DOMContentLoaded', init, false);
    

提交回复
热议问题