Table of Contents


aspx:PartialView

PartialView allows another action to be shown as a partial page (widget) inside another ActiveTemplate or ActivePage:

<aspx:PartialView id='mypartialview' area="aspx" action="myaction" controllerName="MyPageName"  runat="server"/>
 

Properties

PropertyDescription
ControllerNameString, name of the controller
ActionString, name of the action
AreaString, area of the controller such as Force, DynamicsCrm, etc.
RecordIdString, ID of the record if any (optional)
ParameteresList, additional URL parameters.
 

In order to support partial views/widgets, you need to design your action in the following way:

public class MyPageNameController : AspxController
{
      public ActionResponse MyAction()
      {
           //add your code
          Contact model = new Contact();
          return PartialView(model);
      }
}

 

Passing Parameters

PartialView also allows you to pass extra parameters that are mapped to your Action arguments:

<aspx:PartialView id='mypartialview' area="aspx" action="myaction" controllerName="MyPageName" runat="server">
   <parameters>
      <aspx:Param name="id" value='<%# Model.Id %>' runat="server"/>
   </parameters>
</aspx:PartialView>
 

You can then update your Action to accept the "id" parameter:

public class MyPageNameController : AspxController
{
      public ActionResponse MyAction(string id)
      {
           //add your code
          Contact model = Database.Query<Contact>().Where(a=>a.Id == id).First();
          return PartialView(model);
      }
}