PDA

View Full Version : [CLOSED] Migrating to 2: PartialViewResult



PhilG
May 18, 2012, 1:16 PM
Hi,

As part of migrating to ext.net 2, I have in my MVC app some code that uses a PartialViewResult to render a view into an existing tab panel. My controller action for ext.net 1 looks like this:



public ActionResult Manage(string containerId, string installLocationId, string installLocationName)
{
PartialViewResult pr = new PartialViewResult(containerId, RenderMode.AddTo, "Scu");
pr.SingleControl = false;
pr.ControlToRender = "ScuManage";
pr.WrapByScriptTag = false;
pr.ViewData["Title"] = installLocationName;
pr.ViewData["InstallLocationId"] = installId;

return pr;
}


Please can you advise how to do the equivalent in ext.net 2?

Thanks

Matt

Daniil
May 18, 2012, 2:53 PM
Hi,

Generally, it should stay the same. At the first glance.

What issue are you facing?

PhilG
May 18, 2012, 3:10 PM
Hi,

the new PartialViewResult does not contain a constructor that takes 3 arguments - so I can't assign the containerId or RenderMode.

Also, none of these properties exist:


pr.SingleControl = false;
pr.ControlToRender = "ScuManage";
pr.WrapByScriptTag = false;

Thanks

Matt

Daniil
May 18, 2012, 4:00 PM
I guess it's an issue with Namespace. I think you actually use the System.Web.Mvc.PartialViewResult class.

Please try to explicitly set up Namespace:

Ext.Net.MVC.PartialViewResult pr = new Ext.Net.MVC.PartialViewResult();

PhilG
May 21, 2012, 9:27 AM
Of course - I should have noticed this! Thanks