Jul 25, 2012, 7:48 AM
[CLOSED] PartialView in MVC4
Hi,
I tried doing the example from this post http://forums.ext.net/showthread.php...ll=1#post83329 with MVC4 but nothing happen when I click render view. Here is the code:
/Home/Index.cshtml:
Thanks in advance,
I tried doing the example from this post http://forums.ext.net/showthread.php...ll=1#post83329 with MVC4 but nothing happen when I click render view. Here is the code:
/Home/Index.cshtml:
@using Ext.Net
@using Ext.Net.MVC
@{
Layout = "";
}
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
</head>
<body>
@Html.X().ResourceManager()
@(Html.X().Panel()
.ID("Panel1")
.Padding(5)
.Layout(LayoutType.Fit)
.BodyPadding(5)
.Title("Panel1")
.Width(400)
.Height(200)
.Icon(Icon.Add)
.Buttons(buttons => {
buttons.Add(Html.X().Button().Text("Render view").DirectEvents(e => {
e.Click.Url = "/Home/PartialRazorView/";
e.Click.EventMask.ShowMask = true;
e.Click.ExtraParams.Add(new Parameter("containerId", "App.Panel1"));
}));
})
)
@(Html.X().Panel()
.ID("Panel2")
.Padding(5)
.BodyPadding(5)
.Title("Panel2")
.Width(400)
.Height(200)
.Icon(Icon.Add)
.Buttons(buttons => {
buttons.Add(Html.X().Button().Text("Render view").DirectEvents(e => {
e.Click.Url = "/Home/PartialRazorView2/";
e.Click.EventMask.ShowMask = true;
e.Click.ExtraParams.Add(new Parameter("containerId", "App.Panel2.body.id", ParameterMode.Raw));
}));
})
)
</body>
</html>
/Home/PartialRazorView.cshtml:@using Ext.Net.MVC
@(
Html.X().Panel()
.Title("Panel from partial view")
.Content(@<text>
<h3>Simple content</h3>
@Html.X().Button().Text("Button")
</text>)
)
/Controllers/HomeComtroller.cspublic class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public Ext.Net.MVC.PartialViewResult PartialRazorView(string containerId)
{
return new Ext.Net.MVC.PartialViewResult(containerId, RenderMode.AddTo);
}
public Ext.Net.MVC.PartialViewResult PartialRazorView2(string containerId)
{
return new Ext.Net.MVC.PartialViewResult(containerId, RenderMode.RenderTo);
}
}
Do you have any idea to resolve this problem in MVC4Thanks in advance,
Last edited by Daniil; Jul 27, 2012 at 10:35 AM.
Reason: [CLOSED]