0

我正在尝试开发每次单击图像时打开的页面不止弹出窗口。当我单击此图像时,会出现一个弹出菜单,其中 gridview 根据页面中的某些文本框填充了数据。问题是,当我第一次写页面时它起作用了,但后来却没有。

后面的代码是

ImageButton lb = sender as ImageButton;
    string shipto = ddlShipto.SelectedValue.ToString();
    TMWWS.BusinessLogic.ProfileII objPlants = new                 TMWWS.BusinessLogic.ProfileII(shipto);
    DataTable dt = objPlants.getPlantsPerShipto();
    gvPlant.DataSource = dt;
    gvPlant.DataBind();
    this.upPlant.Update();
    //pnlPlant.Visible = true;
    pnlPlant_ModalPopupExtender.Show();



  <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <legend>Order Header</legend>
    <span class="failureNotification" style="color:green">
       <asp:Literal ID="lblMessage" runat="server"></asp:Literal>
    </span>

    <p>
        <asp:Label ID="TransactionLabel" runat="server" 
            AssociatedControlID="txtTransaction" Height="22px" Width="248px">Transaction Number</asp:Label>
        <asp:TextBox ID="txtTransaction" runat="server" CssClass="textEntry" 
            Enabled="False"></asp:TextBox>
    </p>

    <p>
        <asp:Label ID="ShipToLabel" runat="server" 
            AssociatedControlID="txtTransaction" Height="22px" Width="248px">ShipTo</asp:Label>
        <asp:DropDownList ID="ddlShipto" runat="server" CssClass="textEntry" 
            ></asp:DropDownList>
    </p>

    <p>
        <asp:Label ID="FeedCodeLabel" runat="server" AssociatedControlID="txtFeedCode" 
            Height="21px" Width="320px">Feed Code</asp:Label>
        <asp:TextBox ID="txtFeedCode" runat="server" CssClass="textEntry">888</asp:TextBox>
        <asp:RequiredFieldValidator ID="FeedCodeRequired" runat="server" ControlToValidate="txtFeedCode" 
                CssClass="failureNotification" ErrorMessage="Feed Code is required." ToolTip="Feed Code is required." 
                ValidationGroup="OrderValidationGroup">*</asp:RequiredFieldValidator>
    </p>

    <p>
        <asp:Label ID="PlantLabel" runat="server" AssociatedControlID="txtPlant" 
            Height="21px" Width="320px">Plant</asp:Label>

        <asp:TextBox ID="txtPlant" runat="server"></asp:TextBox>
        <asp:ImageButton ID="ImgBtnPlant" runat="server" 
                onclick="ImageButton1_Click" ImageUrl="~/Icons/Plant.png" />
     </p>

    <asp:UpdatePanel ID="upPlant" runat="server" UpdateMode="Conditional">
     <ContentTemplate>
      <asp:Panel runat="server" Visible="false" BorderColor="Black" ID="pnlPlant">
        <asp:Button ID="BtnShowDialog" Style="display:none" runat="server" Width="120" Text="Filter" />
        <asp:Label ID="LblPopupHeader" runat="server" Text="Plant-Filter"></asp:Label>
        <asp:GridView ID="gvPlant" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="Plant" onrowcommand="gvPlant_RowCommand">
            <Columns>
                <asp:BoundField DataField="Plant" HeaderText="Plant" SortExpression="Plant" />
                <asp:BoundField DataField="PlantName" HeaderText="PlantName" 
                    SortExpression="PlantName" />
                <asp:ButtonField Text="Button" />
            </Columns>
        </asp:GridView>
      </asp:Panel>
         <ajaxToolkit:ModalPopupExtender ID="pnlPlant_ModalPopupExtender" runat="server" 
             DynamicServicePath="" Enabled="True" TargetControlID="pnlPlant" PopupControlID="BtnShowDialog">
         </ajaxToolkit:ModalPopupExtender>
     </ContentTemplate>
    </asp:UpdatePanel>   
4

2 回答 2

0

此外,您可以从 Ajax 工具包下载最新版本。我已经下载了它并将它添加到我的VS中的工具箱中。现在它工作正常这里是下载链接:

最新的 ajax 工具包版本

于 2012-06-23T13:46:39.237 回答
0

您可以尝试改用 Popup 扩展程序。这是一件棘手的事情,我遇到了同样的问题,我正在尝试使用弹出扩展器。这是一些代码片段。

<asp:LinkButton ID="LnkOrder" runat="server" BehaviorID="pop" CssClass="PopupMenu" CommandName="LnkOrder">Order</asp:LinkButton>
                     <asp:PopupControlExtender ID="LnkOrder_PopupControlExtender" 
                   runat="server" DynamicServicePath="" Enabled="True" ExtenderControlID="" 
                   PopupControlID="PopupMove" TargetControlID="LnkOrder">
               </asp:PopupControlExtender>

另外我 fyou 需要隐藏弹出窗口尝试使用这个 javascript。不要忘记更改 BehaviorID。这是javascript

$find('pop').hide();
于 2012-06-23T13:35:32.437 回答