Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
on selected index change of a drop down list calendar extender is not working


string strChangeValue = ddlAddchanges.SelectedItem.Text.ToString();

       if (strChangeValue == "Yes")
       {
           txtChangerequiremnetDetails.Enabled = true;
           txtTargetdateforchanges.Enabled = true;
           txtStartdateforchanges.Enabled = true;
           txtEnddateforchanges.Enabled = true;
           txtAgeforchanges.Enabled = true;


       }


the calendar extender is not working on the enabled text boxes.
I have used Update panel in the html page as well

What I have tried:

if (strChangeValue == "Yes")
        {
            txtChangerequiremnetDetails.Enabled = true;
            txtTargetdateforchanges.Enabled = true;
            txtStartdateforchanges.Enabled = true;
            txtEnddateforchanges.Enabled = true;
            txtAgeforchanges.Enabled = true;

            
        }


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true" EnableScriptLocalization="true"
        ID="scr1" ScriptMode="Debug" CombineScripts="false" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="panelEdit" runat="server" Visible="true">
Posted
Updated 21-Jun-17 20:48pm
v2
Comments
TheKarateKid 3-Jun-17 12:28pm    
I can see that you've set the update mode as 'Conditional', Are you calling update on UpdatePanel when SelectedIndexChanged is invoked? e.g. UpdatePanel1.Update();

1 solution

You should use TRIGGERS in UpdatePanel

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                                                    <ContentTemplate>
                 <!--Content-->                                                                                                                                                          </ContentTemplate>
                                                                                    <Triggers>                                                                                        
        <asp:PostBackTrigger ControlID="btnSubmit" />                                                                                    </Triggers>
                                                                                </asp:UpdatePanel>


In trigger section, Use the ID of the button or any control that makes the content post.
 
Share this answer
 

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