Sep 05, 2012, 9:10 PM
MVC PartialViewResult
Hi,
I try to display a partial view by using the following controller code:
when I use System.Web.Mvc.PartialViewResult instead of System.Web.Mvc.PartialViewResult the error disappear.
in all the sample codes I read, that System.Web.Mvc.PartialViewResult should be used.
any advice how to use it?
thanks
Gerald
I try to display a partial view by using the following controller code:
public class SharedController : System.Web.Mvc.Controller
{
public ActionResult PartialView1(string containerId)
{
Ext.Net.MVC.PartialViewResult r = new System.Web.Mvc.PartialViewResult(containerId);
r.ContainerId = containerId;
r.RenderMode = RenderMode.AddTo;
r.SingleControl = true;
return r;
}
}
when the view is suppose to be loaded the view does not show up, and in FireBug I see the following error message.
Exception Details: System.InvalidCastException: Unable to cast object of type 'ASP.views_shared_partialview1_ascx' to type 'System.Web.Mvc.ViewUserControl'.
in all the sample codes I read, that System.Web.Mvc.PartialViewResult should be used.
any advice how to use it?
thanks
Gerald