Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to use calendar when click on asp text box. But text box is in asp wizard step, so jquery is not working in asp:wizardstep.

Please help...

Code is-
HTML
<html lang="en">
<head>
    <title>jQuery UI Datepicker - Default functionality</title>
</head>
<body>
    <form runat="server">
    <asp:ScriptManager ID="ScriptManager2" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
            <script src="//code.jquery.com/jquery-1.10.2.js"></script>
            <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
            <script>
                $(function () {
                    $("#datepicker").datepicker();
                });
            </script>
            <asp:Wizard ID="Wizard1" runat="server">
                <WizardSteps>
                    <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
                        <asp:Panel ID="pnl" runat="server">
                            <asp:TextBox runat="server" type="text" ReadOnly="true" ID="datepicker"></asp:TextBox>
                        </asp:Panel>
                    </asp:WizardStep>
                </WizardSteps>
            </asp:Wizard>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>


If you remove asp:wizard & asp:wizardstepstep it is working fine but with wizard it is not working.
Thanks.
Posted
Updated 23-Dec-15 22:55pm
v2

1 solution

Use ClientID to find text box :

here replace this code :
$(function () {
                   $("#<%= datepicker.ClientID %>").datepicker();
               });
 
Share this answer
 
v2
Comments
Member 11449483 24-Dec-15 5:25am    
it is working fine in my demo but i want to use calendar in wizard step 3 then calender is not working.
please help.
Raje_ 24-Dec-15 5:32am    
Debug in firebug you will see what type of error is coming.
Member 11449483 24-Dec-15 5:35am    
this jquery function load only on pageload but when page redirect(like drop down select value change etc...) jquery not load and calendar not working.
Raje_ 24-Dec-15 5:37am    
Put your jquery and script codes inside head tag.
Member 11449483 24-Dec-15 6:19am    
not working.

Please help.

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



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