Ajaxcontroltoolkit modalpopup extender with dynamic content

asp.net , ajaxcontroltoolkit , modalpopupextender , checkboxlist United States
  • 7 years ago

    I have a checkboxlist populated by a datasource having a textbox as a controlparameter. The checkboxlist is located within a modalpopup. When I click the button, the checkboxlist shows the list pertaining to the previous select. If I close and click the button to show the modalpopup, the second click shows the updated checkboxlist. I've tried everything I can think of and nothing seems to work. The latest attempt is to have a dummy button (arcArcPat) for the modalpopup. I click on btnPrePat to get the dynamic checkbox, but no modalpopup appears. Of course, when I click on btnArcPat, everything's great because I've clicked on the btnPrePat first. I tried taking away the display:none; and then I only get a flash on the screen, nothing that stays. Help?

    <asp:Button ID="btnPrePat" runat="server" Text="pre arc" /><asp:Button ID="btnArcPat" runat="server" text="Search"  /> 
    <ajaxToolkit:ModalPopupExtender ID="mpePat" runat="server" TargetControlID="btnArcPat" PopupControlID="mpPat" DropShadow="true" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender> 
    <asp:Panel ID="mpPat" runat="server" CssClass="modalPopup" Style="display: none;"> 
    <asp:CheckBoxList ID="cblPat" runat="server" RepeatDirection="Vertical" Font-Size="12px" /> 
    <asp:Button ID="btnPatClose" runat="server" Text="Close"   /> 
        Protected Sub btnPrePat_Click(sender As Object, e As EventArgs) Handles btnPrePat.Click 
            ds = New Data.DataSet 
            strSql = "SELECT TOP (100) PERCENT t.patID,  myType FROM blah, blah" 
            da = New Data.SqlClient.SqlDataAdapter(strSql, cn) 
                da.Fill(ds, "patSearch1") 
                If ds.Tables("patSearch1").Rows.Count > 0 Then 
                    cblPat.DataSource = ds.Tables("patSearch1") 
                    cblPat.DataTextField = ds.Tables("pat").Columns("myType").ToString 
                    cblPat.DataValueField = ds.Tables("pat").Columns("patID").ToString 
                End If 
            Catch ex As Exception 
            End Try 
        End Sub
  • 7 years ago

    For anyone else - just wanted you to know that I figured out the bigger problem. Something must have corrupted the ajaxcontroltoolkit installation just enough. Once I re-referenced it, everything started working fine. Sorry for the trouble and thanks for your help.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“You can stand on the shoulders of giants OR a big enough pile of dwarfs, works either way.”