10
Answers

AJAX ModalPopupExtender and three dropdown list in popup panel

aadi patel

aadi patel

12y
10.3k
1
i have three drop down list in panel, and that panel is popup by button click event. (using ajax modalpopupextender).

when i change index of any of drop down list , popup will be disappeared !

i have also used update panel in background of whole page.

i have tried in many ways using update panel with that particular panel but no solution.

here is my code (.aspx)

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<asp:Button ID="buttonshowpopup" runat="server" Style="display: none" />
    <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="buttonshowpopup"
        PopupControlID="Panelpopup" CancelControlID="buttoncancel" BackgroundCssClass="modalBackground">
    </asp:ModalPopupExtender>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="Panelpopup" runat="server" BackColor="White" Height="300px" Width="500px"
                Style="display: none">
                <table width="100%" style="border: Solid 3px #4b6c9e; width: 100%; height: 100%"
                    cellpadding="0" cellspacing="0">
                    <tr style="background-color: #4b6c9e">
                        <td colspan="2" style="height: 10%; color: White; font-weight: bold; font-size: larger"
                            align="center">
                            UPDATE STATUS
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right">
                            SELECT STUDENT NAME:
                        </td>
                        <td style="padding-left: 10px">
                            <asp:DropDownList ID="ddlname" runat="server" Width="200px" AutoPostBack="true"
                                AppendDataBoundItems="true" OnSelectedIndexChanged="Button1_Click">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvddlcarriername" runat="server" ErrorMessage="*"
                                CssClass="errormessage" InitialValue="0" ValidationGroup="updatestatusgroup"
                                ControlToValidate="ddlname"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right">
                            SELECT STATUS :
                        </td>
                        <td style="padding-left: 10px">
                            <asp:DropDownList ID="ddlstatusname" runat="server" Width="200px" AutoPostBack="true"
                                AppendDataBoundItems="true" OnSelectedIndexChanged="Button1_Click">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvddlstatusname" runat="server" ErrorMessage="*"
                                CssClass="errormessage" InitialValue="0" ValidationGroup="updatestatusgroup"
                                ControlToValidate="ddlstatusname"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right">
                            SELECT TYPE :
                        </td>
                        <td style="padding-left: 10px">
                            <asp:DropDownList ID="ddltype" runat="server" Width="200px" AutoPostBack="true"
                                AppendDataBoundItems="true" OnSelectedIndexChanged="Button1_Click">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvddlbusinesstype" runat="server" ErrorMessage="*"
                                CssClass="errormessage" InitialValue="0" ValidationGroup="updatestatusgroup"
                                ControlToValidate="ddltype"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="label_alert" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" width="30%">
                            <asp:Button ID="button_update_status" runat="server" ValidationGroup="updatestatusgroup"
                                Text="UPDATE" OnClick="button_update_status_Click" />
                        </td>
                        <td align="center">
                            <asp:Button ID="buttoncancel" runat="server" Text="CANCEL" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    protected void Button1_Click(object sender, EventArgs e)
    {
        this.ModalPopupExtender2.Show();
    }

 i also have put popup .show method on each dropdown selected index change event.
but i am looking for some advance solution.
please help.

thanks in advance.

my mail id is : [email protected]
Answers (10)