0

現在、アイテムが選択されると、別のドロップダウンメニューに動的に入力されるドロップダウンメニューがあります。これは、ページを単独で表示している場合は問題なく動作しますが、iframe 内でページを表示している場合、ドロップダウン メニューのオプションを変更しても何も起こりません。iframe を含むメイン ページには updatePanel もありますが、何らかのルーティングの問題があると思いますか? 更新がパネルを区別できず、メイン ページのパネルにルーティングされている可能性がありますか? どんな助けでも大歓迎です!

メイン ページのコードはメイン ページと同じように見えます。アイテムを作成していますが、フレーム ページではアイテムを更新しています。

編集: 更新 iframe 以外には何もないテスト ページを作成しましたが、まだ機能しません。iframe 内に読み込まれると、updatepanel が機能しないようです。

aspx:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
       <li>
          <asp:DropDownList ID="CategorySelector" runat="server" AutoPostBack="True" OnSelectedIndexChanged="CategorySelector_SelectedIndexChanged">
                <asp:ListItem Text="--Please Select--" Value="none"></asp:ListItem>
                <asp:ListItem Text="Everything"></asp:ListItem>
                <asp:ListItem Text="Product"></asp:ListItem>
                <asp:ListItem Text="Brand"></asp:ListItem>
                <asp:ListItem Text="Category"></asp:ListItem>
                <asp:ListItem Text="SubCategory"></asp:ListItem>
            </asp:DropDownList>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="CategorySelector" ForeColor="#FF3300" InitialValue="none">*</asp:RequiredFieldValidator>
           </li>
         <li>
           <asp:DropDownList ID="ItemSelector" runat="server">
           </asp:DropDownList></li>   
  </ContentTemplate>
  </asp:UpdatePanel>

コード:

protected void CategorySelector_SelectedIndexChanged(object sender, EventArgs e)

{
    if (CategorySelector.Text == "Product")
        {
            ItemSelector.DataSource = Product.GetAllActive();
            ItemSelector.DataTextField = "Name";
            ItemSelector.DataValueField = "ID";
            ItemSelector.DataBind();
        }
        if (CategorySelector.Text == "Category")
        {
            ItemSelector.DataSource = Category.GetAllActive();
            ItemSelector.DataTextField = "Name";
            ItemSelector.DataValueField = "ID";
            ItemSelector.DataBind();
        }
        if (CategorySelector.Text == "SubCategory")
        {
            ItemSelector.DataSource = SubCategory.GetAllActive();
            ItemSelector.DataTextField = "Name";
            ItemSelector.DataValueField = "ID";
            ItemSelector.DataBind();
        }
        if (CategorySelector.Text == "Brand")
        {
            ItemSelector.DataSource = Brand.GetAllActive();
            ItemSelector.DataTextField = "Name";
            ItemSelector.DataValueField = "ID";
            ItemSelector.DataBind();
        }
        if (CategorySelector.Text == "Everything")
        {
            ItemSelector.Items.Clear();
            ItemSelector.Items.Add("Everything");
        }
}
4

1 に答える 1

0

問題は、fancybox を使用してページを iframe にしているようです。ファンシー ボックスの設定にタイプ iframe を追加するのを忘れていたため、ページ全体がインラインでレンダリングされていました。

$(".modify").fancybox({
    'type': 'iframe'
});

上記のようにタイプ iframe を追加すると、問題が修正されます。

于 2013-10-10T00:55:11.453 に答える