このようなメインページがあります。
<ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" />
<form id="form2" runat="server">
<ext:Panel runat="server" ID="anaPanel" Title="OSO" Icon="Car">
<TopBar>
<ext:Toolbar runat="server" Layout="FitLayout">
<Items>
<ext:Menu ID="Menu1" runat="server" Floating="false" Layout="HBoxLayout" ShowSeparator="false"
AnimCollapse="true" Cls="horizontal-menu">
<Defaults>
<ext:Parameter Name="MenuAlign" Value="tl-bl?" Mode="Value" />
</Defaults>
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Text="" Icon="Group">
<Menu>
<ext:Menu ID="Menu2" runat="server">
<Items>
<ext:MenuItem Text="new card" Icon="GroupAdd">
<DirectEvents>
<Click OnEvent="AddNewCart_Click"></Click>
</DirectEvents>
</ext:MenuItem>
...............
...............
</ext:Panel>
<ext:Window runat="server" ID="MyWindow" Hidden="true"></ext:Window>
</form>
私のmaninpageコードビハインドはこのようなものです。
protected void AddNewCart_Click(object sender, DirectEventArgs e)
{
string path = "Pages/Kart.aspx";
Window win = CreateWindows(MyWindow,Icon.Group,path,"new card", 420, 500);
//private Window CreateWindows(Window Mywindow , Icon ic,string path,string Title, int Heigh, int With){......};
//I get the MyWindow and pass some values and turn it back.
win.Render(this.Form);
win.Show();
}
Kart.aspx 内にいくつかのボタンがあります。最初の質問は、このウィンドウを閉じる方法です。このウィンドウ (Kart.aspx をロードしたウィンドウ) を閉じるボタンを配置しました。それらのどれも機能しませんでした。
1-
if (PreviousPage != null)//previouspage come as a null.
{
Window wnd = PreviousPage.FindControl("MyWindow") as Window;
wnd.Close();
}
2-
Window wnd = Parent.Page.FindControl("MyWindow") as Window;
wnd.Close();
3-メインページ内でMyWindowをパブリックとして作成し、Kart.aspxからアクセスしようとしましたが、2番目の質問は、これらのページ間でパラメーターを渡すにはどうすればよいですか.