Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

IProfileModule

Return to previous page

  • 4/7/2015
  • 2482 Views

Comments

2482 Views

IProfileModule

Last updated long time ago

Comments

Common

(Enter the content of this article below)

Advanced

 
IProfileModule is an interface designed to allow module developers to create modules displayed on User Profile pages. The primary benefit for using this interface is it exposes the ProfileUserId variable (which is the profile currently being viewed) and it also tells the core framework if the current module should be displayed to the public.

IProfileModule requires the implementation of two read-only properties: A boolean DisplayModule and an integer ProfileUserId.

It is worth noting that this interface is implemented by the ProfileModuleUserControlBase class. Developers who are building non-MVP style user profile modules should inherit from that class and thus (through inheritance) will be implementing IProfileModule. If you are developing an MVP style user profile module, you will not be able to inherit from ProfileModuleUserControlBase and will need to implement IProfileModule directly in your code.

Example Code (VB)

Class Declaration


Partial Class ViewProfile
Implements IProfileModule

Implementation


Public ReadOnly Property DisplayModule() As Boolean
Get
Return True
End Get
End Property

Public ReadOnly Property ProfileUserId() As Integer
Get
Dim UserId As Integer = Null.NullInteger
If Not String.IsNullOrEmpty(Request.QueryString("userid")) Then
UserId = Int32.Parse(Request.QueryString("userid"))
End If
Return UserId
End Get
End Property

Example Code (C#)

Class Declaration


partial class ViewProfile : IProfileModule

Implementation


public bool DisplayModule
{
get { return true; }
}

public int ProfileUserId
{
get
{
int UserId = Null.NullInteger;
if (!string.IsNullOrEmpty(Request.QueryString["userid"]))
{
UserId = Int32.Parse(Request.QueryString["userid"]);
}
return UserId;
}
}
Contents
No sections defined
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out