0

私はコンテンツページを持っています。私は asp:updatepanel の後にいくつかの jquery セレクターを書きます。初めて、ページがロードされたときに $(document).ready(function() は正しく動作しますが、ポストバック後、セレクターはもう動作しません。何らかの方法が存在しますこの問題を解決するために??

<asp:content id="Content1" contentplaceholderid="contentplaceholder1" runat="server">       
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
              <asp:TextBox ID="txtdate" runat="server" CssClass="persianDTP" ></asp:TextBox>
                           <!-- some code --> 

           </ContentTemplate>
    </asp:UpdatePanel>

    <script>
                    $(document).ready(function () {
                        $('.PersianDTP').datepicker({
                            showOn: 'button',
                            buttonImage: 'calendar.png',
                            dateFormat: 'yy/mm/dd',
                            //appendText: ' (yy/mm/dd)',
                            changeMonth: true,
                            changeYear: true,
                            //selectOtherMonths: true,
                            //showOtherMonths: true,
                            showStatus: true,
                            showButtonPanel: true,
                            buttonImageOnly: true,
                            buttonText: 'Choose a Date',
                            onClose: function () {
                                this.focus();
                            }
                        });

                        jQuery(function ($) {
                            $(".PersianDTP").mask("9999/99/99");
                        });  

                    });
     </script>
</asp:content>
4

1 に答える 1