0

inside updatepanel condtional mode i am not able to enable/disable my button.

</asp:ToolkitScriptManager><asp:UpdatePanel  ID="UpdatePanel5" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
                    <ContentTemplate> 
                    <div class="buttons"><asp:Button ID="btnReturn" runat="server" Text="Return to Policy" onclick="btnReturn_Click" /> <asp:Button ID="lnkbtnEndorse" runat="server" Text="Import Data" onclick="lnkbtnEndorse_Click" />
                    <asp:Button ID="btnCompareTop" runat="server" Text="Compare" 
                            onclick="Compare_Click" Enabled="false" />                          
                        <asp:Button ID="btnAdditionalInfoOpen" runat="server" Text="Additional Information" /> <asp:Button ID="Button3" runat="server" Text="Save" onclick="SaveCopy_Click" /></div> </ContentTemplate>
           </asp:UpdatePanel> 

i want to enable compare button in cs page.

code behind

grdNewEndorsement.AutoGenerateColumns = false;
        grdNewEndorsement.DataBind();

        this.Button1.Enabled = true;
        this.btnCompareTop.Enabled = true;

Now button is enabled but btnAdditionalInfoOpen button is not opening pop up window

 $('#ctl00_Main_btnAdditionalInfoOpen').click(function () {
                $('#additional-info').dialog('open');
                return false;
            });
Satish Devadiga
  • 35
  • 1
  • 10

1 Answers1

1

If the UpdatePanel's UpdateMode is "Conditional" and ChildrenAsTriggers is "false", you can(have to) update it manually:

this.btnCompareTop.Enabled = true;
UpdatePanel5.Update();

UpdatePanel.Update Method

Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
  • now button is enabled. but btnAdditionalInfoOpen is not opening pop up window. – Satish Devadiga Feb 22 '13 at 12:22
  • @SatishDevadiga: That seems to be a different question since the reason is not related to this issue. I don't see any code that could open a popup. Please open another question with this issue and show all neceassary code and informations. – Tim Schmelter Feb 22 '13 at 12:24
  • if i remove the conditional mode button is enabling without updatepanel5.update method. that time other button inside same update panel not opening popup window. – Satish Devadiga Feb 22 '13 at 12:29
  • @SatishDevadiga: as i've already mentioned, ask a different question. You should not ask multiple question at once. It's also not clear what you have done. Have you updated the panel manually as i've sugested or have you removed the `Conditional` attribute? Also, `ASP.NET Ajax` and `jQuery` don't play well together. http://stackoverflow.com/questions/5662263/jquery-dialog-postback-but-updatepanel-doesnt-get-updated I would suggest to use a `ModalPopupEXtender` instead. – Tim Schmelter Feb 22 '13 at 12:40