views:

53

answers:

1

hi,i am using model popup in asp.net on this linkbutton

<asp:LinkButton ID="LinkButton1" runat="server"  CssClass="addProduct-disable" Enabled ="false" Text="Assign Filter Criteria"  CausesValidation="true"                    ></asp:LinkButton>

when i click a button in popup the event is getting fired but the asp panel and label are not getting displayed

<table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td colspan="3" class="style3" align="center">
                        Assign Filtering Criteria
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;
                        <asp:Label ID="lblSuccess" runat="server" Text="" ></asp:Label>    

                    </td>
                </tr>
                <tr>
                    <td class="logText" width="30%">
                        Filter:
                        <asp:ImageButton ID="imgFilter" runat="server" ImageUrl="../images/helpIcon.png"
                            border="0" CausesValidation="false" OnClientClick="return showHelp('ctl00_ContentPlaceHolder1_pnlFilterHelp');" />
                        <cc1:ModalPopupExtender ID="mdlFilter" runat="server" TargetControlID="imgFilter"
                            PopupControlID="pnlFilterHelp" DropShadow="false" CancelControlID="lnkFilterCancel"
                            X="410" Y="200" />
                        <asp:Panel ID="pnlFilterHelp" runat="server" Height="70px" Width="170px" Style="display: none;">
                            <asp:Panel ID="pnlFilterOuter" runat="server" CssClass="modalPopup2" Height="100px"
                                Width="180px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="#FFFCF9">
                                <table cellpadding="0" cellspacing="0" width="90%">
                                    <tr>
                                        <td align="center" valign="middle" style="padding-top: 15px; padding-left: 5px;">
                                            <table cellpadding="0" align="center" cellspacing="0" width="100%" height="40px">
                                                <tr>
                                                    <td class="style8">
                                                        Set Filter Criteria so that customer can easily search product.
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding-left: 20px;">
                                            <asp:LinkButton ID="lnkFilterCancel" runat="server" Text="" CssClass="gridPagerlink"
                                                ForeColor="Black">Close <b>X</b></asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </asp:Panel>
                    </td>
                    <td width="4px">
                    </td>
                    <td class="logBox">
                        <asp:UpdatePanel ID="filter" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="drpFilter" runat="server" AutoPostBack="True" OnSelectedIndexChanged="drpFilter_SelectedIndexChanged"
                                    Width="150px">
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="logText">
                        Filter Option:
                        <asp:ImageButton ID="imgFilterOption" runat="server" ImageUrl="../images/helpIcon.png"
                            border="0" CausesValidation="false" OnClientClick="return showHelp('ctl00_ContentPlaceHolder1_pnlFilterOption');" />
                        <cc1:ModalPopupExtender ID="mdlFilterOption" runat="server" TargetControlID="imgFilterOption"
                            PopupControlID="pnlFilterOption" DropShadow="false" CancelControlID="lnkFilterOptionCancel"
                            X="410" Y="220" />
                        <asp:Panel ID="pnlFilterOption" runat="server" Height="70px" Width="170px" Style="display: none;">
                            <asp:Panel ID="pnlFilterOptionOuter" runat="server" CssClass="modalPopup2" Height="300px"
                                Width="580px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="#FFFCF9">
                                <table cellpadding="0" cellspacing="0" width="90%">
                                    <tr>
                                        <td align="center" valign="middle" style="padding-top: 15px; padding-left: 5px;">
                                            <table cellpadding="0" align="center" cellspacing="0" width="100%" height="40px">
                                                <tr>
                                                    <td class="style8">
                                                        Set Filter Criteria Option so that customer can easily search product.
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding-left: 20px;">
                                            <asp:LinkButton ID="lnkFilterOptionCancel" runat="server" Text="" CssClass="gridPagerlink"
                                                ForeColor="Black">Close <b>X</b></asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </asp:Panel>
                    </td>
                    <td width="4px">
                    </td>
                    <td class="logBox">
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="drpFilterOption" runat="server" Width="150px" Enabled="false">
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="logText">
                        &nbsp;
                    </td>
                    <td width="4px">
                    </td>
                    <td class="logBox">
                        &nbsp;
                        <asp:UpdatePanel ID="cancel" runat="server">
                            <ContentTemplate>
                                <asp:Button ID="btnAdd" runat="server" Style="font-weight: 700; text-align: right"
                                    Text="Add" CssClass="Login-btn" OnClick="btnAdd_Click" />
                            </ContentTemplate>
                        </asp:UpdatePanel>

            </td> </tr>
            <tr>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td colspan="2">
                </td>
            </tr>
            <tr>
                <td align="center" colspan="3">
                    <asp:Panel ID="pnlAddFilter" runat="server" style="display:none">
                        <table id="list">
                        </table>
                        <div id="pager" style="text-align: center;">
                        </div>
                        <br />
                      </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>

            </tr>
            </table>

event is

protected void btnAdd_Click(object sender, EventArgs e)
    {
        pnlAddFilter.Style.Add("display", "block");
        //pnlAddFilter.Visible = true;
        DataTable dtFilter = new DataTable();
        dtFilter.Columns.Add("FOId");
        dtFilter.Columns.Add("Filtername");
        dtFilter.Columns.Add("FilterOption");
        DataRow drFilter;
        if (Session["Filter"] != null)
        {
            dtFilter = (DataTable)Session["Filter"];
        }

        drFilter = dtFilter.NewRow();
        drFilter["FOId"] = drpFilterOption.SelectedValue;
        drFilter["Filtername"] = drpFilter.SelectedItem.Text;
        drFilter["FilterOption"] = drpFilterOption.SelectedItem.Text;
        dtFilter.Rows.Add(drFilter);
        Session["Filter"] = dtFilter;
        btnAdd.Enabled = false;
        if (Session["Filter"] == null)
        {
          //  pnlAddFilter.Visible = false;
            pnlAddFilter.Style.Add("display", "none");
        }
        else
        {
            pnlAddFilter.Style.Add("display", "block");
          //  pnlAddFilter.Visible = true;
        }
        lblSuccess.Visible = true;
        lblSuccess.Text = AppHardcodeValue.strAddFilterProduct; 
    }      
A: 

In my experience, the modal popup doesn't support dynamically rendered data very well. I'm thinking you probably need to put your modal content inside of an update panel in order to be able to use the server side code to update the label.

Achilles