Basic Configuration

Look closely at the example template that was installed. The first requirement is that you add the assembly reference to the top of your template:

<xmod:Register TagPrefix="rmg" Namespace="Reflect.XModPro.ImpersonateX.Template" Assembly="Reflect.XModPro.ImpersonateX" />
Your template

The next item you'll find in the example template is an asset helper. It looks like this:

<xmod:Register TagPrefix="rmg" Namespace="Reflect.XModPro.ImpersonateX.Template" Assembly="Reflect.XModPro.ImpersonateX" />

 <rmg:Assets></rmg:Assets> 
Your template

The asset helper is entirely optional. All it does is loads a namespaced version of the bootstrap stylesheet. You'll notice that your template code is wrapped in a <div class="xmp">...</div>. This enables the example template to use styles that won't conflict with your skin. If you're already using bootstrap, you can remove this assets tag. In reality, you can do whatever you want. You can remove it and create your own CSS for the solution. This is just another one of the awesome benefits of XMod Pro!

Next, all you have to do is add the ImpersonateX tag in your template. You can see from the example template that it's used within the <ItemTemplate>:

<ItemTemplate>
  <tr>
    <td>[[UserID]]</td>
    <td>[[Username]]</td>
    <td>[[Firstname]]</td>
    <td>[[Lastname]]</td>
    <td>[[Email]]</td>
    <td align="center"> <rmg:ImpersonateX CssClass="btn btn-warning" UserID='[[UserID]]' Redirect="."  Text="Impersonate" /> </td>
  </tr>
</ItemTemplate>
Your template

As you can see, you must pass the UserID of the account you wish to impersonate into the control. You can also control the page to redirect to. See the next section on options for more information.

Use the syntax below to add the custom action to your XMod Pro form.

<AddForm>

  ...
  
  

  <Action Assembly="Reflect.XModPro.ImpersonateX" Namespace="FormActions.ImpersonateX">
    <Property Name="UserID" Value="[[UserID]]" />
  </Action>
  
</AddForm>
Your form

If you want, you can also leverage XMod Pro's <Redirect> tag by placing it after ImpersonateX:

<AddForm>

  ...
  
  

  <Action Assembly="Reflect.XModPro.ImpersonateX" Namespace="FormActions.ImpersonateX">
    <Property Name="UserID" Value="[[UserID]]" />
  </Action>
  
  <Redirect Method="Get" Target="/" />
  
</AddForm>
Your form

Newsletter

Keep up on our always evolving product features and technology. Enter your e-mail and subscribe to our newsletter.

About Us

At Reflect Media Group we are committed to developing effective solutions for our clients. We specialize in building custom modules and web apps with Xmod Pro for the DNN (DotNetNuke) CMS platform. We also offer consultation, training, and in-depth project evaluation.

Get In Touch

  • Address: PO Box 329, West Paducah, KY 42086, USA

  • Phone: (270) 933-1200

  • Email: Contact Form