weixin_33693070 2010-12-14 11:53 采纳率: 0%
浏览 99

模态弹出扩展器问题

i use modal popup extender to show my details in another separate window it is a panel contains some controls the problem is :: when i click on my button which contains:: the Show() method the parent page just frozen and no popup appears at all on the other side i have a grid view when i click on the last button on it the popup appears where the other buttons on the grid view make the same behavior of my first button , i donot know what is the problem my panel visibility = true and no setting in my behind code..i view the source and i find the panel with its contents then why the popup window doesnot appear..i search alot but i donot find a solution to my problem .. my aspx::

<asp:Panel id="master_editMode"  runat="server"  >                    
                 <div id="masterDiv" style="width:98%"  dir="rtl">
                    <div id="masterControls"  align="center">
                    <table border="0" width="98%">


                        <tr>
                            <td align="center" dir="rtl">
                                <asp:ObjectDataSource ID="ObjDS_AllTasks" runat="server" 
                                    SelectMethod="Get_All_Tasks" TypeName="DocumentFlowModuleDTO.TaskDTO">
                                </asp:ObjectDataSource>
                                <asp:HiddenField ID="hd_Task_Code" runat="server" />
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label11" runat="server" Text="Search for Task" Visible="False"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:TextBox ID="txt_Search" runat="server" AutoPostBack="True" 
                                                ontextchanged="txt_Search_TextChanged" Width="200px" Visible="False"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">


                                            <asp:GridView ID="grd_AllTasks" runat="server" AllowPaging="True" 
                                                AutoGenerateColumns="False" CssClass="Alternating" DataKeyNames="task_code" 
                                                DataSourceID="ObjDS_AllTasks" 
                                                onpageindexchanging="grd_AllTasks_PageIndexChanging" 
                                                onrowdatabound="grd_AllTasks_RowDataBound" style="margin-right: 0px">
                                                <RowStyle VerticalAlign="Top" />

                                                    HeaderText="ÍÐÝ">
                                                        <ItemTemplate>
                                                            <asp:ImageButton ID="btn_Delete_Task" runat="server" 
                                                                CommandArgument="<%# Bind('task_code') %>" Height="33px" 
                                                                ImageUrl="~/Images/delete.png" oncommand="btn_Delete_Task_Command" 
                                                                Width="67px" />
                                                            <cc1:ConfirmButtonExtender ID="btn_Delete_Task_ConfirmButtonExtender" 
                                                                runat="server" ConfirmText="åá ÊÑíÏ ÍÐÝ æËíÞÉ ÇáÇÚÊãÇÏ ¿" Enabled="True" 
                                                                TargetControlID="btn_Delete_Task">
                                                            </cc1:ConfirmButtonExtender>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <HeaderStyle HorizontalAlign="Right" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" dir="rtl">
                                <asp:Label ID="lbl_TaskName" runat="server" Font-Bold="True" Font-Size="13pt"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" dir="rtl" style="height: 196px">
                                <table>
                                    <tr>
                                        <td align="left">
                                            <asp:Label ID="lbl_No_States" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:ImageButton ID="btn_AddStatesToTask" runat="server" 
                                                ImageUrl="Images/add.png" onclick="btn_AddStatesToTask_Click" Visible="False" />

                                            <asp:Button ID="Dummy_btn2" runat="server" Text="Button" Style="display:none;" /> 
                                            <cc1:ModalPopupExtender ID="btn_AddStatesToTask_ModalPopupExtender" 
                                                runat="server" 
                                                TargetControlID="Dummy_btn2"
                                                BackgroundCssClass="modalBackground" 
                                                PopupControlID="pnl_Add_States"
                                                DropShadow="True">
                                            </cc1:ModalPopupExtender>
                                        </td>
                                    </tr>
                                </table>
                                <asp:HiddenField ID="hd_StateSerial" runat="server" />
                                <asp:HiddenField ID="hd_StateRowIndex" runat="server" />
                                <asp:GridView ID="grd_States" runat="server" AllowPaging="True" DataKeyNames="state_serial" 
                                    onpageindexchanging="grd_States_PageIndexChanging" Visible="False" 
                                    CssClass="Alternating" AutoGenerateColumns="False">
                                    <Columns>
                                        <asp:BoundField DataField="state_name" HeaderText="ÇáãÑÍáÉ" 
                                            ShowHeader="False" />
                                        <asp:BoundField DataField="state_order" HeaderText="ÊÑÊíÈ ÇáãÑÍáÉ" 
                                            ShowHeader="False" />
                                        <asp:TemplateField HeaderText="Power" ShowHeader="False">
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chb_StatePower" runat="server" 
                                                    Checked='<%# Convert.ToBoolean(Eval("power_flag")) %>' Enabled="False" />
                                            </ItemTemplate>
                                            <ItemStyle Width="40px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="New" ShowHeader="False">
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="CheckBox3" runat="server" />


                                                <asp:Button ID="Dummy_btn4" runat="server" Text="Button" Style="display:none;" />

                                                            <cc1:ModalPopupExtender ID="btn_TaskState_Edit_ModalPopupExtender" runat="server"
                                                            TargetControlID="Dummy_btn4"
                                                            BackgroundCssClass="modalBackground" 
                                                            PopupControlID="pnl_Add_States"
                                                            DropShadow="True">
                                                            </cc1:ModalPopupExtender>

                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ÍÐÝ" ShowHeader="False">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="btn_TaskState_Delete" runat="server" 
                                                    CommandArgument="<%# Bind('state_serial') %>" Height="26px" 
                                                    ImageUrl="~/Images/delete.png" oncommand="btn_TaskState_Delete_Command" 
                                                    Width="47px" />
                                                <cc1:ConfirmButtonExtender ID="btn_TaskState_Delete_ConfirmButtonExtender" 
                                                    runat="server" ConfirmText="åá ÊÑíÏ ÍÐÝ ÇáãÑÍáÉ ¿" Enabled="True" 
                                                    TargetControlID="btn_TaskState_Delete">
                                                </cc1:ConfirmButtonExtender>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:ObjectDataSource ID="ObjectDataSource_States" runat="server" 
                                    SelectMethod="Select_TaskStates" TypeName="DocumentFlowModule.DTO.TaskStateDTO">
                                    <SelectParameters>
                                        <asp:Parameter Name="task_code" Type="Int32" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </td>
                        </tr>
                    </table>
                    </div>
                </div>
            </asp:Panel>


        <asp:Panel ID="pnl_Add_Task" runat="server" CssClass="modalPopup"><%-- Style="display:none;"--%>
          <div id="div3" style="width: 95%">
                <div id="div4" align="center">
                    <table>
                        <tr>
                        <td>
                            <asp:UpdatePanel ID="UpPnl1" runat="server">
                                <ContentTemplate> 
                                    <table dir="rtl" style="text-align: right">
                                        <tr bgcolor="#f1ece2">
                                            <th align="right" height="35" valign="middle" colspan="3">
                                                <asp:Label ID="lbl_New_Task" runat="server" Font-Bold="False" Font-Size="14pt" 
                                                    Text="ÅÖÇÝÉ æËíÞÉ ÇÚÊãÇÏ" Visible="False"></asp:Label>
                                                <asp:Label ID="lbl_Edit_Task" runat="server" Font-Bold="False" Font-Size="14pt" 
                                                    Text="ÊÚÏíá æËíÞÉ ÇÚÊãÇÏ" Visible="False"></asp:Label>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td class="title" width="160">

                                                <asp:Label ID="Label1" runat="server" Text="Task Name"></asp:Label>

                                            </td>
                                            <td style="width: 140px">

                                                <asp:TextBox ID="txt_TaskName" runat="server"></asp:TextBox>

                                            </td>
                                            <td>

                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                    ControlToValidate="txt_TaskName" ErrorMessage="*" ValidationGroup="G1"></asp:RequiredFieldValidator>

                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="title" width="160">

                                                <asp:Label ID="Label10" runat="server" Text="DataBase Name"></asp:Label>

                                            </td>
                                            <td style="width: 140px">


                                                <asp:DropDownList ID="ddl_DataBases" runat="server" AutoPostBack="True" 
                                                    ondatabound="ddl_DataBases_DataBound" 
                                                    onselectedindexchanged="ddl_DataBases_SelectedIndexChanged">
                                                </asp:DropDownList>


                                            </td>
                                            <td>


                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                                    ControlToValidate="ddl_DataBases" ErrorMessage="*" InitialValue="--Select--" 
                                                    ValidationGroup="G1"></asp:RequiredFieldValidator>


                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="title" width="160">

                                               <asp:Label ID="Label2" runat="server" Text="Table Name"></asp:Label>
                                            </td>
                                            <td style="width: 140px">
                                            <asp:DropDownList ID="ddl_Tables" runat="server" AutoPostBack="True" 
                                                            ondatabound="ddl_Tables_DataBound" 
                                                            onselectedindexchanged="ddl_Tables_SelectedIndexChanged">
                                                        </asp:DropDownList>

                                            </td>
                                            <td>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                                            ControlToValidate="ddl_Tables" ErrorMessage="*" InitialValue="--Select--" 
                                                            ValidationGroup="G1"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                                                    <td class="title" width="160">

                                                                        <asp:Label ID="Label17" runat="server" Text="Table Key"></asp:Label>

                                                                    </td>

                                                                    <td style="width: 140px">
                                                                        <asp:Label ID="lbl_Key" runat="server"></asp:Label>
                                                                        <asp:CheckBoxList ID="cbl_Columns" runat="server">
                                                                        </asp:CheckBoxList>
                                                                    </td>

                                                                    <td>

                                                                        <asp:Label ID="lbl_Select_Key" runat="server" ForeColor="Red"></asp:Label>

                                                                    </td>
                                                                </tr>

                                        <tr>
                                                                    <td class="title" width="160">

                                                                        <asp:Label ID="Label18" runat="server" Text="Current Record State"></asp:Label>

                                                                    </td>

                                                                    <td style="width: 140px">
                                                                        <asp:DropDownList ID="ddl_Columns" runat="server" AutoPostBack="True" 
                                                                            ondatabound="ddl_Columns_DataBound">
                                                                        </asp:DropDownList>
                                                                    </td>

                                                                    <td>

                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                                                            ControlToValidate="ddl_Columns" ErrorMessage="*" InitialValue="--Select--" 
                                                                            ValidationGroup="G1"></asp:RequiredFieldValidator>
                                                                    </td>
                                                                </tr>
                                        <tr>
                                            <td class="title" width="160">
                                                <asp:Label ID="Label5" runat="server" Text="Form View "></asp:Label>
                                            </td>
                                            <td style="width: 140px">
                                                <asp:TextBox ID="txt_F_View" runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                                    ControlToValidate="txt_F_View" ErrorMessage="*" InitialValue="--Select--" 
                                                    ValidationGroup="G1"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="title" width="160">
                                                <asp:Label ID="Label6" runat="server" Text="Form New"></asp:Label>
                                            </td>

                                            </td>
                                        </tr>                                         

                          </table>
                 </ContentTemplate>

                </asp:UpdatePanel>
                </td>
                </tr>
                <tr>                                   
                                <td dir="rtl" align="center">
                                    <asp:ImageButton ID="btn_OK" runat="server" ImageUrl="~/Images/add.png" 
                                        onclick="btn_OK_Click" ValidationGroup="G1" Visible="False" />
                                    <asp:ImageButton ID="btn_Edit" runat="server" ImageUrl="~/Images/edit.png" 
                                        onclick="btn_Edit_Click" ValidationGroup="G1" Visible="False" />
                                    <asp:ImageButton ID="btn_Cancel_Task" runat="server" CausesValidation="False" 
                                        Height="36px" ImageUrl="~/Images/cancel.png" onclick="btn_Cancel_Task_Click" />
                                </td>
                            </tr>
               </table>


                </div>

                </div>
        </asp:Panel>

the btn_add _task does not make my popup appear just freeze the parent page


my .cs

protected void btn_Add_Task_Click(object sender, EventArgs e)
    {

        //AjaxControlToolkit.ModalPopupExtender modal1 = (AjaxControlToolkit.ModalPopupExtender) table1.FindControl("btn_Add_Task_ModalPopupExtender");
        //modal1.Show();

        grd_States.Visible = false;
        lbl_No_States.Text = "";
        btn_AddStatesToTask.Visible = false;
        lbl_TaskName.Text = "";

        //master_editMode.Visible = true;

        //pnl_Add_Task.Visible = true;

        btn_OK.Visible = true;
        btn_Edit.Visible = false;
        lbl_New_Task.Visible = true;
        lbl_Edit_Task.Visible = false;

        txt_TaskName.Text = "";
        ddl_DataBases.ClearSelection();
        ddl_Tables.Items.Clear();
        ddl_Columns.Items.Clear();
        cbl_Columns.Items.Clear();
        txt_F_New.Text = "";
        txt_F_View.Text = "";
        txt_Params.Text = "";
        txt_SP_Name.Text = "";

        btn_Add_Task_ModalPopupExtender.Show();

    }

thanks in advance

EDITED::

<table align="center" dir="rtl"> <tr> <td > <asp:Button ID="Dummy_btn" runat="server" Text="Button" Style="display:none;" />

                                                <asp:Button ID="btn_Add_Task"  runat="server" Text="ÅÖÇÝÉ æËíÞÉ ÇÚÊãÇÏ ÌÏíÏÉ" 
                                                    onclick="btn_Add_Task_Click" Font-Bold="True" Font-Size="12pt" 
                                                    ForeColor="#0066FF" />

                                                <cc1:ModalPopupExtender ID="btn_Add_Task_ModalPopupExtender" runat="server" 
                                                    TargetControlID="Dummy_btn"
                                                    PopupControlID="pnl_Add_Task"
                                                    BackgroundCssClass="modalBackground"
                                                    DropShadow="True" >

                                                </cc1:ModalPopupExtender>

                                            </td>
                                        </tr>
                                    </table>`
  • 写回答

2条回答 默认 最新

  • weixin_33724659 2010-12-15 09:21
    关注

    If you want your modal popup to be displayed when the user clicks on the btn_Add_Task button, you should set that button as the TargetControlID of the extender:

    <cc1:ModalPopupExtender ID="btn_Add_Task_ModalPopupExtender" runat="server" 
        TargetControlID="btn_Add_Task" PopupControlID="pnl_Add_Task"
        BackgroundCssClass="modalBackground" DropShadow="True" />
    

    In your current code, the modal popup is triggered by a button named Dummy_btn, which I can't find in your markup, but which probably isn't what you want.

    评论

报告相同问题?

悬赏问题

  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?