Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Under Update Panel
ASP.NET
<div class="col-md-6">
    <div class="form-group">
        <label for="userEmail">Session:</label>
        <asp:TextBox ID="txtDate5"    runat="server"  ></asp:TextBox>
        <script>
        $('#<%=txtDate5.ClientID %>').datepicker({
            uiLibrary: 'bootstrap4'
        });
        </script>
        <asp:RequiredFieldValidator ID="Req_ID"
            Display="Dynamic" runat="server"
            ControlToValidate="txtDate5"
            InitialValue="0"
            ErrorMessage="Please Select Session" 
            Style=" color:red"
        >
        </asp:RequiredFieldValidator> 
    </div>
</div>


What I have tried:

bootstrap datepicker not working after postback in updatepanel
Posted
Updated 14-Oct-19 9:02am
v2

1 solution

You haven't posted enough of your code, but chances it's not working because the elements you have attached your jquery events to are being deleted and re-created by the update panel, so the items your events are attached to no longer exists so they can't fire.

Use the pageLoad event to attach your events, it fires after updatepanel updates too.

How to run javascript after updatepanel execution completed | The ASP.NET Forums[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900