PortSight Secure Access Documentation

Adding a User Control (List of Users) to Your Page


In this tutorial you will learn how to use a user control in your page. You will use ARUIUserList control to display a customized list of users.

  1. Open your project with Secure Access authentication implemented. Add a new page called UserList.aspx.

  2. Check if the SecureAccess.dll library is referenced in your application. If not, add a reference to your application. You can find the DLL file in the DLLs folder in the Secure Access installation folder.

  3. If you didn't choose to copy files in the Application Configuration Wizard please copy the following files and folders from the SecureAccess Web interface (you will typically find it in the "C:\inetpub\wwwroot\SecureAccess" folder) into your application's directory:

    • Modules/ARUIUserList.ascx

    • images

    • styles

    • functions

  4. Add following lines at the beginning of the page code-behind, so that you can use Secure Access user interface library in this page.

    [Visual Basic]
    Imports SecureAccess 
    using SecureAccess;								

  5. Put the following line on the first line of the UserList.aspx HTML source code:

     <%@ Register TagPrefix="uc1" TagName="ARUIUserList" Src="Modules/ARUIUserList.ascx" %> 								

    Put the following line inside the <form>...</form> tags:

     <uc1:ARUIUserList id="ARUIUserList1" runat="server"></uc1:ARUIUserList> 																

    What you did:

    You placed a Secure Access control UserList.ascx that displays list of users on the page.

  6. Add following lines inside the <HEAD> element to link CSS style sheets and functions for Secure Access controls:

    <link href="Styles/ARStyles.css" type="text/css" rel="stylesheet">
    <script src="functions/ARUIOpenWin.js"></script>

  7. Add the "Protected WithEvents ..." ("protected ..." in C#) line into the page code-behind just after the class definition:

    [Visual Basic]
    Public Class UserList
        Inherits System.Web.UI.Page
        Protected WithEvents ARUIUserList1 As ARUIUserList
    public class UserList : System.Web.UI.Page
    	protected ARUIUserList ARUIUserList1;

  8. Add following code in the page code-behind:

    [Visual Basic]
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ARUIUserList1.EventRaise = False
    End Sub
    private void Page_Load(object sender, System.EventArgs e)
    	ARUIUserList1.EventRaise = false;

    What you did:

  9. Compile and run your application. Log on and navigate to the UserList.aspx page. You should see list of users with filter and paging.