使用AspxPageControl更改选项卡

时间:2016-08-12 07:23:50

标签: javascript jquery asp.net devexpress devexpress-mvc

我在更改AspxPageControl中的标签时出现问题。我使用此工具动态显示我的网页。当我更改我的活动标签时,旧标签会消失。我搜索了一下,发现这个问题可以通过在缓存或会话中保存状态来解决。

然而,我真的是开发网络应用程序的新手。我怎样才能做到这一点 ?我也在我的项目中使用了jquery ui,但它没有用。所以我用这个工具改变了我的项目。此外,我可以就有动态网页的页面提供建议。

此按钮基本上在我的选项卡上添加了一个新页面,并在此选项卡上设置了活动页面:

protected void bt_yeniEklenenler_Click(object sender, EventArgs e)
    {
        YeniEklenen_count= YeniEklenen_count + 1;

        TabPage tab = new TabPage();
        tab.Text = "Yeni Eklenenler";
        tab.Name = "tab_yenieklenenler" + YeniEklenen_count.ToString();


        LiteralControl l = new LiteralControl("<iframe src='YeniEklenenler.aspx' runat='client' id='frm2' style='width: 99 %; height: 78vh; margin - top:20px'></ iframe >");


        l.ID = "lit_yenieklenenler" + YeniEklenen_count.ToString();

        tab.Controls.Add(l);

        ASPxPageControl1.TabPages.Add(tab);

        ASPxPageControl1.ActiveTabPage = ASPxPageControl1.TabPages.FindByName(tab.Name);



    }

我的设计来源:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:ScriptManager runat="server" ID="ScriptManager1">
        </asp:ScriptManager>
        <asp:Button ID="bt_yeniEklenenler" runat="server" OnClick="bt_yeniEklenenler_Click" Text="Yeni Eklenenler" OnClientClick="ButtonClick();" />
        <asp:Button ID="bt_kampanya" runat="server" Text="Kampanya" OnClick="bt_kampanya_Click" />
        <asp:Button ID="bt_fiyatListesi" runat="server" Text="Fiyat Listesi" OnClick="bt_fiyatListesi_Click" />
        <asp:Button ID="bt_sepetim" runat="server" Text="Sepetim" OnClick="bt_sepetim_Click" />
        <asp:Button ID="bt_siparisListesi" runat="server" Text="Sipariş Listesi" OnClick="bt_siparisListesi_Click" />
        <asp:Button ID="bt_firmaBilgileri" runat="server" Text="Firma Bilgileri" OnClick="bt_firmaBilgileri_Click" />
        <asp:Button ID="bt_cariHareket" runat="server" Text="Cari Hareket" OnClick="bt_cariHareket_Click" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" OnClick="Button1_Click" Text="KAPAT" />
        <dx:ASPxPageControl runat="server" ActiveTabIndex="0" RenderMode="Lightweight" Width="1146px" Height="555px" ID="ASPxPageControl1" OnActiveTabChanged="ASPxPageControl1_ActiveTabChanged" AutoPostBack="True">
            <TabPages>
                <dx:TabPage Text="Ana Sayfa">
                    <ContentCollection>
                        <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                            <h1 style="text-align:center">_____ SİSTEMİNE HOŞGELDİNİZ...</h1>
                            <h1 style="text-align:center">&nbsp;</h1>
                            <h1 style="text-align:center">
                                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="KAPAT" />
                            </h1>
                        </dx:ContentControl>
                    </ContentCollection>
                </dx:TabPage>
            </TabPages>

        </dx:ASPxPageControl>

    </ContentTemplate>
</asp:UpdatePanel>

注意:我也试过打开AutoPostBack,但是当我点击另一个标签时我的标签不会改变。

提前致谢:)