Nov 01, 2011, 1:05 PM
Issue with autoload partial content to window (MVC)
Hello All,
I am newbie in ext.net, however had small experience using ExtJS before. I am trying to create window that would be able to load content from partial views. The window itself I am creating using JS. Here is a simple example:
javascript function to create window
The first time when I opended this window calling openDialog() function all wass fine. The view is correctly displayed. However when I closed the window and tryied to open it again, after some time whole content of the view was disappeared and I am not able to close the window.
Do you have ideas what I did wrong?
Thanks,
Alexander
I am newbie in ext.net, however had small experience using ExtJS before. I am trying to create window that would be able to load content from partial views. The window itself I am creating using JS. Here is a simple example:
javascript function to create window
showDialog: function () {
var config = {
title: "Creating new tender - General description - Step 1/6",
id: 'Window1',
width: 700,
height: 500,
renderTo: Ext.getBody(),
maximizable: true,
minimizable: true,
layout: 'fit',
resizable: true,
autoLoad: {
url: "/Tender/StartTender",
params: {
containerId: "Window1"
},
showMask: true,
noCache: true,
maskMsg: "Loading page...",
scripts: true
}
};
var w = new Ext.Window(config);
w.show();
w.center();
view example<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" ClientIDMode="Static" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Panel ID="Panel1" runat="server" Layout="Accordion" Border="false">
<Items>
<ext:Panel ID="Panel2" runat="server" Title="Item1" />
<ext:Panel ID="Panel3" runat="server" Title="Item2" />
<ext:Panel ID="Panel4" runat="server" Title="Item3" />
<ext:Panel ID="Panel5" runat="server" Title="Item4" />
<ext:Panel ID="Panel6" runat="server" Title="Item5" />
</Items>
</ext:Panel>
controller examplepublic ActionResult StartTender(string containerId)
{
CCX.Web.Common.PartialViewResult pr = new CCX.Web.Common.PartialViewResult(containerId);
pr.RenderMode = RenderMode.AddTo;
pr.SingleControl = true;
pr.WrapByScriptTag = true;
return pr;
}
The first time when I opended this window calling openDialog() function all wass fine. The view is correctly displayed. However when I closed the window and tryied to open it again, after some time whole content of the view was disappeared and I am not able to close the window.
Do you have ideas what I did wrong?
Thanks,
Alexander